since 0.28.0
#import "Extensions/Testing/Discovery";
The metaprogram plugin behind jacket test: jaic tests.jai +Extensions/Testing/Discovery.
It collects the program's procedures with a @test or @bench note, then adds a table of
the tests and an entry point, __jacket_test_main, that runs them (Testing's run_tests).
The program's own main, if it has one, stays as it is and does not run.
Its one option, list, is for a program that is only listed (jacket test --list): the
@compile_time tests are named but not run, since nothing will replay what they report.
It prints what it found on standard output as records, the framing the
test program's own records use (\x02, the kind, each field after \x1f, then \x03):
manifest one per test and bench: kind, name, file, line, then its notes
source one per line of the code it adds, for a program that adds it itself, since
-interp compiles much less of a program than a build with a plugin does
(jacket test --interp)
discovered last: everything above is out
Printing works for a target whose compile-time code cannot write files (-os wasm).
Show moreShow less
Only procedures of the main program are collected, and only those at file level outside
#scope_file, since the table is added at the top level and has to name them.