Skip to content

autogtest

Release Build status Commit activity License

Autogtest is a CLI tool for auto-generating Google Mock test code from C++ header files.

Features

  • Automatically generates Google Mock classes from C++ abstract interfaces
  • Supports both single file and batch processing modes
  • Customizable Jinja2 templates for mock generation
  • Handles nested namespaces and nested class

Installation

pip install autogtest

Basic Usage

Generate mock for a single header:

autogtest path/to/header.h --mock output/mock.h --include base/include

Batch process a directory:

autogtest path/to/headers/ --mock output/mocks/ --include base/include

Command Options

autogtest [HEADER]
  --mock TEXT     Output path (file or directory)
  --include TEXT  Base include directory
  --template TEXT Custom template path