IMPORTANT NOTE: Running the test servers!
===============--------------------------
When you "make tjazz" and run it using ./tjazz, the tests expect both zeroMQ and http test servers running.
The servers are in the folder Jazz/server/test_servers/
There are three servers:
./serve_a2m.py
./serve_alpha.py
./serve_htm.py
They are simple python 3 scripts. You can pip install anything required (flask and zmq). You have to keep the three scripts running.
Jazz 0.5+ uses Catch2
=====================
IMPORTANT NOTE: The single file header version of Catch is PATCHED !!
---------------
To avoid a naming conflict with the macro WARN (from R.h), the Catch macro WARN is renamed to CWARN.
Always rename (manually) when updating to a new catch version.
Instructions on testing
-----------------------
Testing is done using Catch https://github.com/philsquared/Catch
Catch converts Jazz into an executable with its own help, made by;
make tjazz (also, make runtest makes tjazz and runs it with: ./bin_test/tjazz -d yes
A typical BDD test looks like:
------------------------------
#if defined CATCH_TEST
SCENARIO("Testing something.")
{
(code here)
REQUIRE((many assertions));
GIVEN("Something")
{
(code here)
REQUIRE((many assertions));
WHEN("Whatever")
{
(code here)
REQUIRE((many assertions));
THEN("Yesss")
{
(code here)
REQUIRE((many assertions));
}
}
}
}
#endif
Useful commands are:
--------------------
make runtest // Runs showing times. Note that some messages are in reverse order since time can
// only be measured when finished and events are nested.
./bin_test/tjazz -s -a // Shows every detail "-s", but ABORTS "-a" so the last test is the one failing.
./bin_test/tjazz -help // Shows this help
Catch v1.5.9
usage:
tjazz [ ...] [options]
where options are:
-?, -h, --help display usage information
-l, --list-tests list all/matching test cases
-t, --list-tags list all/matching tags
-s, --success include successful tests in output
-b, --break break into debugger on failure
-e, --nothrow skip exception tests
-i, --invisibles show invisibles (tabs, newlines)
-o, --out output filename
-r, --reporter reporter to use (defaults to console)
-n, --name suite name
-a, --abort abort at first failure
-x, --abortx abort after x failures
-w, --warn enable warnings
-d, --durations show test durations
-f, --input-file load test names to run from a file
-#, --filenames-as-tags adds a tag for the filename
--list-test-names-only list all/matching test cases names only
--list-reporters list all reporters
--order test case order (defaults to decl)
--rng-seed <'time'|number> set a specific seed for random numbers
--force-colour force colourised output (deprecated)
--use-colour should output be colourised
For more detail usage please see the project docs