Micro-toolkit

microtest

Small C libraries need tests without bringing in a runtime dependency.

A single-header framework provides assertions, suites, fixtures, filtering and custom output.

DevelopmentMITC99
Last verified
Not audited against current README/docs
Platform scope
Portable C99; integration depends on caller-provided adapters

What it solves

Small C libraries need tests without bringing in a runtime dependency.

How it works

1Test macro2suite runner3assertion result4output

Use it when

Write unit tests for a C library
Run named suites across translation units
Route test output to a custom sink

Quick Start

#define MTEST_IMPLEMENTATION
#include "mtest.h"
MTEST(add){MTEST_ASSERT_EQ(2+2,4);}
MTEST_SUITE(math){MTEST_RUN(add);}
/* Expected: the math suite reports a passing test. */

Engineering evidence

  • CMake package export and consumer verification are documented

Known limits

  • No thread-safety, freestanding or ISR claim
  • Host sanitizers were not verified in the documented run