conquest/testsuite
Tuomas Koskela 6d31ee9ffe Merge branch 'tk-refactor-testsuite' of github.com:OrderN/CONQUEST-release into tk-refactor-testsuite 2023-07-06 09:26:54 +01:00
..
test_001_bulk_Si_1proc_Diag Add python script for checking output, rename reference outputs 2023-05-26 15:45:10 +01:00
test_002_bulk_Si_1proc_OrderN Add python script for checking output, rename reference outputs 2023-05-26 15:45:10 +01:00
test_003_bulk_BTO_polarisation Added reference for polarisation test 2023-06-23 09:55:11 +01:00
.gitignore Implementation of test for polarisation and correction of bug 2023-06-15 17:26:37 +01:00
README.md Update README.md 2023-07-03 14:20:46 +01:00
run_conquest_tests.sh Add documentation in README 2023-05-30 10:51:17 +01:00
test_check_output.py Move example code into docstring 2023-07-06 09:25:54 +01:00

README.md

CONQUEST test suite.

This directory currently contains three end-to-end tests

  • test_001_bulk_Si_1proc_Diag
  • test_002_bulk_Si_1proc_OrderN
  • test_003_bulk_BTO_polarisation

for Conquest, and a simple python pytest script for checking the correctness of the outputs.

Usage

To run the tests

  1. Compile Conquest with make in ../src
  2. Run the Conquest executable in the subdirectories named test_00*
  3. Check the correctness of the outputs with pytest

These steps can be run automatically using the script run_conquest_test.sh in this directry.

Contributing

To add new tests

  1. Add input files and a sample output file (run with IO.Iprint 0 and named Conquest_out.ref) in a new subdirectory under testsuite. The naming convention is test directory names start with test_ followed by a running index with three digits, e.g. 004.
  2. Add a new test to TestClass in test_check_output.py. You can use one of the current tests, named test_XXX as templates.
    • Update the directory name passed to path
    • Update the list of parameters in the @pytest.mark.parametrize decorator. The key parameters correspond to fields in the Conquest_out file to be checked against the reference.
    • If necessary, update the read_conquest_out() function to parse a new field from the output.
    • If necessary, update the precision() function to return a custom precision for a given value of the key parameter.
  3. Add it as a new Run test XXX step to the CI workflow