Merge pull request #2329 from myerspat/distribution-alias-sampling

Alias sampling implementation for discrete PDFs
This commit is contained in:
Paul Romano 2023-01-31 10:08:11 -06:00 committed by GitHub
commit 7a736cc3a4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 399 additions and 206 deletions

View file

@ -45,7 +45,7 @@ Prerequisites
Running Tests
-------------
To execute the test suite, go to the ``tests/`` directory and run::
To execute the Python test suite, go to the ``tests/`` directory and run::
pytest
@ -55,6 +55,14 @@ installed and run::
pytest --cov=../openmc --cov-report=html
To execute the C++ test suite, go to your build directory and run::
ctest
If you want to view testing output on failure run::
ctest --output-on-failure
Generating XML Inputs
---------------------
@ -66,6 +74,23 @@ run::
pytest --build-inputs <name-of-test>
Adding C++ Unit Tests
---------------------
The C++ test suite uses Catch2 integrated with CTest. Each header file should
have a corresponding test file in ``tests/cpp_unit_tests/``. If the test file
does not exist run::
touch test_<name-of-header-file>.cpp
The file must be added to the CMake build system in
``tests/cpp_unit_tests/CMakeLists.txt``. ``test_<name-of-header-file>`` should
be added to ``TEST_NAMES``.
To add a test case to ``test_<name-of-header-file>.cpp`` ensure
``catch2/catch_test_macros.hpp`` is included. A unit test can then be added
using the ``TEST_CASE`` macro and the ``REQUIRE`` assertion from Catch2.
Adding Tests to the Regression Suite
------------------------------------