A tiny TAP generator library and TAP parser in C for Linux, OSX
picotap is a tiny TAP generator library (test) and TAP parser (test harness) written in C. It was inspired by code in kazuho's github projects.
C Prequisites:
- tap requires GCC or clang/LLVM on Linux or OSX
If you get stuck in Linux or OSX, try typing make help
or looking at the Examples directory.
Try the following:
make
make help
make libtap
make ptap
make install
make tests
make runtest
make runtap
- In
picotap/
, type:make libtap
- Include
tap.h
into your test file - Start your test source with
plan( 10 ); // If your test plan includes 10 tests
- Each test is of the form
ok( condition, "Info about the test" );
condition
can be any expression that resolves totrue
/false
- For output to stdout not part of the test plan results
- Prefix with a
space
,tab
, or#
- Prefix with a
- Compile your test code by including the path to
tap.h
and linking tolibptap.a
cc test.c -I./picotap -L. -lptap -o test.exe
- See the
picotap/t
directory and themake tests
command inpicotap/Makefile
- In
picotap/
, type:make ptap
- Execute the test via the tap parser
./ptap /PATH/TO/test.exe
ptap
will open a pipe totest.exe
, reading itsstdout
and parse it- For output to stdout not part of the test plan results
- Prefix with a
space
,tab
, or#
- Prefix with a