b2testrunner (B2000++ Pro) — Run B2000++ test cases


b2testrunner [-f] [-h] [-j jobs] [-l size] [-m] [-n name] [-t resultdir] [-v level] TESTDIR


The b2testrunner program is available in B2000++ Pro; it runs all B2000++ test cases located in the directory TESTDIR, printing the name and and short description of each test case, together with the test result (OK, FAIL, and ERROR). ERROR means that the test could not be successfully run, while FAIL means that execution was successful, but the computed values were found to be incorrect. After all tests have been executed, the b2testrunner program prints to the console a summary of all test cases that did not succeed.

b2testrunner is launched from a shell. It creates several temporary directories in the directory where it is launched, thus, it is advised to run it from the /tmp directory.

A typical use is:

$ cd /tmp
$ b2testrunner -j 8 /opt/smr/share/B2000++/test_cases

The amount of information printed by the b2testrunner program can be large. In the following example, the output is written to both the terminal and the file out.txt[11], which can be inspected with an editor:

$ cd /tmp
$ b2testrunner -j 8 /opt/smr/share/B2000++/test_cases 2>&1 | tee out.txt



Path to the top-level directory containing the tests to be run. All test cases found in this directory and in its subdirectories will be run (if the -n option is not used).



Run also those test that are known to fail. Default is to run only those tests that are not marked as known-to-fail.


Print a summary of command-line options and arguments to the command-line.

-j jobs

Run jobs test cases in parallel. The number of jobs should be equal to the number of CPU cores.

-l size

Depending on the value of size (small, medium, big, and all), run only test cases that are marked up to the specified size. By default, all test cases are run. Specifying -l small will run most basic tests (since they are small), but not the time-consuming test cases. Thus, this option is useful for quick testing during development.


Run the b2000++ program via the run-time memory checker valgrind, which will detect and report any memory corruption problem caused by bugs in application or library code. Note that valgrind will slow down program execution dramatically, hence it is best used on a single test case.

-n name

Run only those test cases where the name of the test function matches the pattern name. For instance, -n q4 will only run tests with Q4 elements.

-t resultdir

By default, b2testrunner creates for each test case a temporary directory in the current directory. This directory contains the, the B2000++ MDL file(s), the B2000++ database b2test.b2m for that test case. When the test cases have been run, these directories are removed.

When the -t is specified, the directory resultdir is created and will contain a copy of the test case directory hierarchy. This way, the MDL files, the B2000++ databases, the logs, etc. can be inspected after the execution of the test case(s).

-v level

Set the level of verbosity (0, 1, 2). Default is 2.

[11] The bash shell's redirection operator and pipeline operators are used together with the teecommand. For other shells, the redirection operator 2>&1 may be different.