diff --git a/DDTest/CMakeLists.txt b/DDTest/CMakeLists.txt index 428ec775762412fa0b56fdf912f950351ef8ee37..481351e019e5ca84bb96ecf6ab578486847e9128 100644 --- a/DDTest/CMakeLists.txt +++ b/DDTest/CMakeLists.txt @@ -51,6 +51,11 @@ ADD_TEST( t_test_python_import "${CMAKE_INSTALL_PREFIX}/bin/run_test.sh" SET_TESTS_PROPERTIES( t_test_python_import PROPERTIES FAIL_REGULAR_EXPRESSION "Exception;EXCEPTION;ERROR;Error" ) if (DD4HEP_USE_GEANT4) + + ADD_TEST( t_test_python_import_ddg4 "${CMAKE_INSTALL_PREFIX}/bin/run_test.sh" + pytest ${PROJECT_SOURCE_DIR}/DDTest/python/test_import_ddg4.py) + SET_TESTS_PROPERTIES( t_test_python_import_ddg4 PROPERTIES FAIL_REGULAR_EXPRESSION "Exception;EXCEPTION;ERROR;Error" ) + foreach(TEST_NAME test_EventReaders ) diff --git a/DDTest/python/test_import.py b/DDTest/python/test_import.py index b5454cb04bdff30b19b108bea648b26ac3a45b12..6c658fe177f58515ce4147cd42f16d43dbcd6fe1 100644 --- a/DDTest/python/test_import.py +++ b/DDTest/python/test_import.py @@ -1,6 +1,7 @@ #!/usr/bin/env python """ -Some imports to make sure that the DD4hep environment is complete +Some imports to make sure that the DD4hep environment is complete. +Since it can be disabled in CMake, the import of DDG4 is tested in another file. """ from __future__ import absolute_import, unicode_literals, print_function import traceback @@ -11,7 +12,6 @@ parametrize = pytest.mark.parametrize moduleNames = [ 'dd4hep', - 'DDG4', 'DDRec', 'DDDigi', ] diff --git a/DDTest/python/test_import_ddg4.py b/DDTest/python/test_import_ddg4.py new file mode 100644 index 0000000000000000000000000000000000000000..122a1e4f21cf348cfede5d70058e5b5c1439e5cc --- /dev/null +++ b/DDTest/python/test_import_ddg4.py @@ -0,0 +1,18 @@ +#!/usr/bin/env python +""" +Some imports to make sure that the DD4hep environment is complete. +This file adds a test for the DDG4 python module. +""" + +from __future__ import absolute_import +from test_import import test_module, parametrize + + +moduleNames = [ + 'DDG4', + ] + + +@parametrize('moduleName', moduleNames) +def test_module_ddg4(moduleName): + test_module(moduleName)