Skip to content

CLI Reference

Usage: aceunit [OPTION]... OBJECT_FILE...

Generates the AceUnit fixture list from compiled test-case object files. The generated test suite is written to stdout.

Flag Argument Meaning
-b BINARY tool binary Use BINARY instead of the default for the selected tool. Example: -b m68k-amigaos-objdump.
-h Display help and exit.
-n NAME table name Use NAME instead of fixtures for the generated fixture table symbol.
-p PATTERN grep regex Require this prefix before test-function names. PATTERN must be understood by grep. Example: -p '[^_]\+_' to allow any prefix followed by an underscore.
-s PATTERN grep regex Strip this prefix from symbol names before use. Example: -s _ to strip a leading underscore.
-t TOOL nm | objdump | readelf Symbol-table tool to use. Defaults to objdump.
-v Print version information and exit.
Terminal window
aceunit leapyear_test.o >testcases.c

Scans leapyear_test.o for test functions, writes generated fixtures to testcases.c.

Terminal window
aceunit -t nm -b m68k-amigaos-nm -s _ leapyear_test.o >testcases.c

Uses nm (specifically the m68k-amigaos-nm binary) to read the symbol table, stripping a leading underscore from symbol names — typical for cross-compiling to a target with an underscore-prefixed C ABI.

Terminal window
aceunit -t readelf a.o b.o c.o >testcases.c

Scans multiple object files at once, using readelf for the symbol table.

Given the (optional) prefix from -p, AceUnit matches functions in each object file against:

  • ${prefix}beforeAll
  • ${prefix}afterAll
  • ${prefix}beforeEach
  • ${prefix}afterEach
  • ${prefix}test*

See Core Concepts for what each of these does at runtime.