Commit Graph

10 Commits

Author SHA1 Message Date
Kgothatso Ngako
d9549a6c5a tests: raise MAX_ARGS from 200 to 400
With the chilldkg (and iceberg) modules enabled, the unit test binary
registers more than 200 tests (213 with all modules on), tripping the
"Number of tests exceeds MAX_ARGS" internal error in unit_test.c and
bailing before running anything -- both tests and noverify_tests were
unrunnable in the all-modules CI rows. MAX_ARGS must be at least the
total number of registered tests; 400 leaves headroom for future
modules and vector-suite growth.
2026-08-31 13:25:26 +02:00
DarkWindman
f7e7e6bb15 Merge branch 'master' into sync-7262adb4 2026-04-01 17:29:57 +03:00
mllwchrry
d8e87e45f3 unit_test: bump MAX_ARGS from 150 to 200 2026-03-03 13:08:07 +02:00
Sebastian Falbesoner
921b9711ea util: introduce and use ARRAY_SIZE macro
The macro definition matches the one used in Linux, see e.g.
9702969978/include/linux/array_size.h (L11)
(without the additional check rejecting pointers, as we would need
 GNU C for that, see e.g. https://stackoverflow.com/a/19455169)
2026-02-17 00:21:58 +01:00
furszy
2f4546ce56 test: add --log option to display tests execution
When enabled (--log=1), shows test start, completion, and execution time.
2025-10-01 10:19:05 -04:00
furszy
95b9953ea4 test: Add option to display all available tests
Useful option to avoid opening the large tests.c file just to find
the test case you want to run.
2025-10-01 10:19:05 -04:00
furszy
953f7b0088 test: support running specific tests/modules targets
Add support for specifying single tests or modules to run via the
"--target" or "-t" command-line option. Multiple targets can be
provided; only the specified tests or all tests in the specified
module/s will run instead of the full suite.

Examples:
-t=<test name> runs an specific test.
-t=<module name> runs all tests within the specified module.

Both options can be provided multiple times.
2025-10-01 10:19:05 -04:00
furszy
0302c1a3d7 test: add --help for command-line options
Add a help message for the test suite, documenting available options,
defaults, and backward-compatible positional arguments.
2025-10-01 10:17:57 -04:00
furszy
9ec3bfe22d test: adapt modules to the new test infrastructure
This not only provides a structural improvement but also
allows us to (1) specify individual tests to run and (2)
execute each of them concurrently.
2025-10-01 10:17:57 -04:00
furszy
48789dafc2 test: introduce (mini) unit test framework
Lightweight unit testing framework, providing a structured way to define,
execute, and report tests. It includes a central test registry, a flexible
command-line argument parser of the form "--key=value" / "-k=value" /
"-key=value" (facilitating future framework extensions), ability to run
tests in parallel and accumulated test time logging reports.

So far the supported command-line args are:
- "--jobs=<num>" or "-j=<num>" to specify the number of parallel workers.
- "--seed=<hex>" to specify the RNG seed (random if not set).
- "--iterations=<num>" or "-i=<num>" to specify the number of iterations.

Compatibility Note:
To stay compatible with previous versions, the framework also supports
the two original positional arguments: the iterations count and the
RNG seed (in that order).
2025-10-01 10:17:57 -04:00