From ff48f53595144aa0ecbc1f44f2d28428a7306633 Mon Sep 17 00:00:00 2001 From: erkn Date: Thu, 22 Dec 2022 12:04:29 +0100 Subject: [PATCH] skip mcpl-test if it is not enabled patterned after the dagmc-tests This required the MCPL_ENABLED symbol to be unmangled --- include/openmc/source.h | 1 + tests/regression_tests/source_mcpl_file/test.py | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/include/openmc/source.h b/include/openmc/source.h index bb7e2d55f7..051167b3f6 100644 --- a/include/openmc/source.h +++ b/include/openmc/source.h @@ -32,6 +32,7 @@ constexpr double EXTSRC_REJECT_FRACTION {0.05}; //============================================================================== // Global variables //============================================================================== +extern "C" const bool MCPL_ENABLED; class Source; diff --git a/tests/regression_tests/source_mcpl_file/test.py b/tests/regression_tests/source_mcpl_file/test.py index a005fc2d83..0b8e79104e 100644 --- a/tests/regression_tests/source_mcpl_file/test.py +++ b/tests/regression_tests/source_mcpl_file/test.py @@ -1,10 +1,13 @@ #!/usr/bin/env python - +import openmc.lib +import pytest import glob import os from tests.testing_harness import * - +pytestmark = pytest.mark.skipif( + not openmc.lib._mcpl_enabled(), + reason="MCPL is not enabled.") settings1="""