Skip to content

FAQ

Why no annotations, like the old AceUnit or other frameworks?

Section titled “Why no annotations, like the old AceUnit or other frameworks?”

Annotation-style processing (A_Test, A_BeforeClass, …) needed a fragile source-code parser and, in the old version, a Java-based generator. The current version reads the compiled object file’s symbol table instead, so it only needs naming conventions — no parser, no extra language runtime for the generator. See Migration Guide.

Can I use AceUnit on an embedded target with no OS?

Section titled “Can I use AceUnit on an embedded target with no OS?”

Yes — that’s a primary design goal. The SetJmpRunner works in freestanding environments as long as <setjmp.h> is available (true for most real-world embedded toolchains, though not guaranteed by the C standard). See Core Concepts and Cross-compilation & Embedded Targets.

Simple for learning/TDD practice, SetJmp/Abort for freestanding or hosted environments respectively, Fork for real projects on a POSIX host where you want crash-survival and full test-run reporting. Comparison table: Core Concepts.

How do I test code that wasn’t written to be testable — like something calling puts() or defining main()?

Section titled “How do I test code that wasn’t written to be testable — like something calling puts() or defining main()?”

See Mocking — five different strategies (objcopy renaming, linker --wrap, compile-time macros, Darwin interposition, or stdout capture) depending on your toolchain.

./aceunit fails with declare: -g: invalid option

Section titled “./aceunit fails with declare: -g: invalid option”

You’re running it with an unsupported shell. AceUnit’s generator script needs Bash 5, ksh, or zsh — common on macOS where /bin/bash is very old. Run ./configure.sh to patch in a supported shell automatically, or edit the shebang in bin/aceunit yourself. See Installation.

Is AceUnit meant to be shipped as part of a production system?

Section titled “Is AceUnit meant to be shipped as part of a production system?”

No — it’s a development tool. See Security for the disclosure policy that follows from that.