See the full changelog.
Features
-
Added the ability to randomize the order in which suites and tests are executed (3cedb38). The default is sequential (
--order=sequential
), which executes suites and tests in the order they were originally defined. By specifying the option--order=random
for the test executable, the order is randomized, which might help with finding unintentional dependencies between different suites and tests. The seed used for the run is printed out at the end and can be input again using the option--seed=<seed>
to reproduce the results.--- Summary --- Suites: 1 Passed (100.00%), 0 Failed (0.00%), 1 Total Tests: 67 Passed (100.00%), 0 Skipped (0.00%), 0 Failed (0.00%), 67 Total Wall: 6.123 ms, CPU: 0.000 ns Note: Suites and tests were executed in a random order. Specify '--seed=42' to reproduce this run.
-
Added a simple pseudorandom number generator (PRNG) based on the xoshiro256** variant (3cedb38).
Changes
-
Removed the extensive file comments to prevent them from getting out of sync (60aa47c). They provided little value, as they mostly repeated what was already specified in the documentation. More documentation and examples may be added in the future.
-
Revised and improved the error handling all around the library (0616d0f, d06feb1). This results in some breaking changes to the function signatures, but makes the library a bit more uniform and ergonomic to use. The following now applies:
-
Pointers are generally assumed to be valid (i. e. not equal to
nullptr
and pointing to valid, allocated memory) unless specified otherwise. -
If an error code provides little extra value to indicate a failure, it is omitted and the return value of a function is used instead (if possible).
SCUnitTimer* scunit_timer_new();
-
If a function has a procedural character (i. e. called primarily for its side-effect), the return value of the function is used to return an error code.
SCUnitError scunit_timer_start(SCUnitTimer* timer);
-
If the primary goal of a function is to compute or return a value, the error code is placed as the last out parameter.
SCUnitMeasurement scunit_timer_getWallTime(const SCUnitTimer* timer, SCUnitError* error);
-
-
Improved the parsing of the command line arguments to support widely used conventions (fe920fb). This adds a new dependency, the GNU extension
getopt_long()
. -
Renamed the option
--colored-output
to--color
and the possible argumentsdisabled
tonever
andenabled
toalways
to follow widely used conventions (1ee265a). The corresponding functions for getting and setting the colored output in code were moved from the print module to the main scunit module. -
Splitted
scunit_main()
from<SCUnit/scunit.h>
into two separate functions,scunit_parseArguments()
andscunit_executeSuites()
, which can now be called any number of times (3cedb38).