|
Peano
|
Run the ExaParty test cases through pytest. More...
Functions | |
| exaparty_is_built () | |
| Check if the ExaParty libraries exist. | |
| run_script (script) | |
| Run one ExaParty run script from within its directory. | |
| test_functional (script) | |
| test_physics (script) | |
Variables | |
| TESTS_DIRECTORY = Path(__file__).resolve().parent | |
| PEANO_ROOT_DIRECTORY = TESTS_DIRECTORY.parent.parent | |
| list | FUNCTIONAL_TESTS |
| list | PHYSICS_TESTS |
Run the ExaParty test cases through pytest.
Each ExaParty test case lives in its own directory and ships a run script which generates the code, compiles it, runs the executable and, where available, compares the outcome against a reference. This module runs these scripts one by one. A test passes if its script returns with exit code zero.
All tests are integration tests, i.e. you have to request them explicitly:
python3 -m pytest -m integration tests/exaparty python3 -m pytest -m "integration and not slow" tests/exaparty python3 -m pytest -m integration tests/exaparty -k sod-1d
They require a Peano build with –enable-particles –enable-exaparty and are skipped otherwise. The scripts write their generated code, executables and outputs into their own directories, exactly as if you ran them by hand.
| test_exaparty.exaparty_is_built | ( | ) |
Check if the ExaParty libraries exist.
We look into the directories which the generated Makefiles use as well, i.e. PEANO_CMAKE_BUILD_DIR and PEANO_SRC_ROOT_DIR take precedence over the repository this file belongs to.
Definition at line 55 of file test_exaparty.py.
Referenced by run_script().

| test_exaparty.run_script | ( | script | ) |
Run one ExaParty run script from within its directory.
| script | str Path of the run script relative to tests/exaparty. |
We run the script through bash with pipefail, as most scripts pipe the executable's output through tee, which otherwise hides a crash. python3 resolves to the interpreter that runs pytest, and src/ is added to the PYTHONPATH, so the generator scripts find Peano's Python API.
Definition at line 72 of file test_exaparty.py.
References exaparty_is_built().
Referenced by test_functional(), and test_physics().


| test_exaparty.test_functional | ( | script | ) |
Definition at line 105 of file test_exaparty.py.
References run_script().

| test_exaparty.test_physics | ( | script | ) |
Definition at line 112 of file test_exaparty.py.
References run_script().

| list test_exaparty.FUNCTIONAL_TESTS |
Definition at line 30 of file test_exaparty.py.
| test_exaparty.PEANO_ROOT_DIRECTORY = TESTS_DIRECTORY.parent.parent |
Definition at line 28 of file test_exaparty.py.
| list test_exaparty.PHYSICS_TESTS |
Definition at line 44 of file test_exaparty.py.
| test_exaparty.TESTS_DIRECTORY = Path(__file__).resolve().parent |
Definition at line 27 of file test_exaparty.py.