diff --git a/tests/regression_tests/model_xml/adj_cell_rotation_inputs_true.dat b/tests/regression_tests/model_xml/adj_cell_rotation_inputs_true.dat new file mode 100644 index 0000000000..3b14f304ea --- /dev/null +++ b/tests/regression_tests/model_xml/adj_cell_rotation_inputs_true.dat @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + eigenvalue + 10000 + 10 + 5 + + + -4.0 -4.0 -4.0 4.0 4.0 4.0 + + + + diff --git a/tests/regression_tests/model_xml/energy_laws_inputs_true.dat b/tests/regression_tests/model_xml/energy_laws_inputs_true.dat new file mode 100644 index 0000000000..62485ff72a --- /dev/null +++ b/tests/regression_tests/model_xml/energy_laws_inputs_true.dat @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + eigenvalue + 1000 + 10 + 5 + + diff --git a/tests/regression_tests/model_xml/lattice_multiple_inputs_true.dat b/tests/regression_tests/model_xml/lattice_multiple_inputs_true.dat new file mode 100644 index 0000000000..d828b25f6b --- /dev/null +++ b/tests/regression_tests/model_xml/lattice_multiple_inputs_true.dat @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + 1.2 1.2 + 1 + 2 2 + -1.2 -1.2 + +2 1 +1 1 + + + 2.4 2.4 + 2 2 + -2.4 -2.4 + +4 4 +4 4 + + + + + + + + + + eigenvalue + 1000 + 10 + 5 + + diff --git a/tests/regression_tests/model_xml/photon_production_inputs_true.dat b/tests/regression_tests/model_xml/photon_production_inputs_true.dat new file mode 100644 index 0000000000..9e60033bec --- /dev/null +++ b/tests/regression_tests/model_xml/photon_production_inputs_true.dat @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + fixed source + 10000 + 1 + + + 0 0 0 + + + + 14000000.0 1.0 + + + ttb + true + + 1000.0 + + + + + 1 + + + neutron photon electron positron + + + 1 2 + current + + + 2 + Al27 total + total (n,gamma) + tracklength + + + 2 + Al27 total + total heating (n,gamma) + collision + + + 2 + Al27 total + total heating (n,gamma) + analog + + + diff --git a/tests/regression_tests/model_xml/test.py b/tests/regression_tests/model_xml/test.py index 51c25a603b..9da5438db6 100644 --- a/tests/regression_tests/model_xml/test.py +++ b/tests/regression_tests/model_xml/test.py @@ -10,9 +10,9 @@ from tests.testing_harness import PyAPITestHarness, colorize # use a few models from other tests to make sure the same results are # produced when using a single model.xml file as input from ..adj_cell_rotation.test import model as adj_cell_rotation_model -from ..lattice_multiple.test import model as lattice_mult_model +from ..lattice_multiple.test import model as lattice_multiple_model from ..energy_laws.test import model as energy_laws_model -from ..photon_production.test import model as photon_prod_model +from ..photon_production.test import model as photon_production_model class ModelXMLTestHarness(PyAPITestHarness): @@ -30,10 +30,10 @@ class ModelXMLTestHarness(PyAPITestHarness): def _get_inputs(self): return open('model.xml').read() - def _compare_inputs(self): - """Skip input comparisons for now - """ - pass + # def _compare_inputs(self): + # """Skip input comparisons for now + # """ + # pass def _compare_results(self): """Make sure the current results agree with the reference.""" @@ -54,25 +54,23 @@ class ModelXMLTestHarness(PyAPITestHarness): os.remove('model.xml') -models = [ - 'adj_cell_rotation_model', - 'lattice_mult_model', - 'energy_laws_model', - 'photon_prod_model' -] -paths = [ - '../adj_cell_rotation', - '../lattice_multiple', - '../energy_laws', - '../photon_production' +test_names = [ + 'adj_cell_rotation', + 'lattice_multiple', + 'energy_laws', + 'photon_production' ] -@pytest.mark.parametrize("model, path", zip(models, paths)) -def test_model_xml(model, path, request): - inputs = path + "/inputs_true.dat" - results = path + "/results_true.dat" - harness = ModelXMLTestHarness(request.getfixturevalue(model), inputs, results) +@pytest.mark.parametrize("test_name", test_names, ids=lambda test: test) +def test_model_xml(test_name, request): + openmc.reset_auto_ids() + + test_path = '../' + test_name + results = test_path + "/results_true.dat" + inputs = test_name + "_inputs_true.dat" + model_name = test_name + "_model" + harness = ModelXMLTestHarness(request.getfixturevalue(model_name), inputs, results) harness.main() def test_input_arg(run_in_tmpdir):