1. Introduction
The B2000++ examples collection describes typical B2000++ use
cases. All example cases are explained step by step and can be
reproduced by the user. Examples cases are an integral part of the
verification suite. The examples are distributed with B2000++ build
and are located under <prefix>/share/b2000pp_data/examples
.
Note
Test case descriptions refer to the B2EXAMPLES
environment variable. B2EXAMPLES
is an alias to the
examples top-level directory, such as
<prefix>/share/b2000pp_data/examples
. It might be
handy to define B2EXAMPLES
in your $HOME/profile
file (bash
example):
export B2EXAMPLES=<prefix>/share/b2000pp_data/examples
The B2000++ examples scripts must be executed with the Python 3 version of B2000++. Please make sure to activate the correct Python 3 module file.
Example cases are launched with the b2testrunner application. Some cases can be launched with make scripts if available. Specific data processing capabilities by the Simples module or the baspl++ post-processor are described in the text and also documented in the scripts.
B2000++ examples can be run one by one (see relevant README files) or all together with the b2testrunner program.
To launch an example case Run test case with the b2testrunner from a shell:
b2testrunner [-j <njobs>] <path-to-tests>
To redirect output to a file:
b2testrunner [-j <njobs>] . >b2testrunner.out 2>&1
Example cases can be executed concurrently with the -j
option. Example: Run with 12 threads:
b2testrunner -j 12 .
Individual tests can also be launched with the b2testrunner application from their respective directories.
Some example cases can also be executed with make. Check
with the relevant directories, where additional descriptive text in
README
files can be found. The Makefile
files found in the
relevant directories usually contain the following targets:
Typing
make
with the default target in a shell usually runs the test as documented, by executing B2000++ with the relevant MDL input file.To clean up the directory by removing the generated model database (a file with the extension
.b2m
) and other files and directories created by the test, typemake clean
Example cases can easily be added to the test case suite. Adding tests
should be limited to testing features not captured by one of the
existing tests or to testing bugged features. While SMR maintains the
‘official’ test case suite, users can add tests to the sub-directory
additional
.