Warning, /geant4/cmake/Modules/G4CTest.cmake is written in an unsupported language. File is not indexed.
0001 # - Basic setup for testing Geant4 using CMake/CTest
0002 #
0003 #-----------------------------------------------------------------------
0004 # Integration and unit tests
0005 # - "ENABLE_TESTING" means all tests under tests/
0006 option(GEANT4_ENABLE_TESTING "Enable and define all the tests of the project" OFF)
0007 geant4_add_feature(GEANT4_ENABLE_TESTING "Enable and define all the tests of the project")
0008 mark_as_advanced(GEANT4_ENABLE_TESTING)
0009
0010 #-----------------------------------------------------------------------
0011 # Configure CTest and relevant Geant4 settings, if required
0012 #
0013 if(GEANT4_ENABLE_TESTING)
0014 # - Core CTest
0015 enable_testing()
0016 include(CTest)
0017
0018 # - Geant4_DIR is needed to locate GeantConfig.cmake file required
0019 # by tests and examples
0020 set(Geant4_DIR ${PROJECT_BINARY_DIR} CACHE PATH "Current build directory")
0021
0022 # - Add datasets to testing environment
0023 geant4_get_datasetnames(_dslist)
0024 foreach(_ds ${_dslist})
0025 geant4_get_dataset_property(${_ds} ENVVAR _dsenvvar)
0026 geant4_get_dataset_property(${_ds} BUILD_DIR _dspath)
0027 list(APPEND GEANT4_TEST_ENVIRONMENT ${_dsenvvar}=${_dspath})
0028 endforeach()
0029
0030 # - Add base URL for test reference files
0031 set(GEANT4_TEST_REFERENCES_URL "http://cern.ch/geant4-data/stt/references/" CACHE
0032 STRING "base URL for test reference files")
0033 mark_as_advanced(GEANT4_TEST_REFERENCES_URL)
0034
0035 # - Add TOOLS_FONT_PATH if freetype enabled
0036 if(GEANT4_USE_FREETYPE)
0037 list(APPEND GEANT4_TEST_ENVIRONMENT TOOLS_FONT_PATH=${PROJECT_SOURCE_DIR}/source/externals/g4tools/fonts)
0038 endif()
0039
0040 # - Configure 'G4RunManagerFactory::CreateRunManager(G4RunManagerType::Default)'
0041 # to use TBB
0042 if(GEANT4_BUILD_MULTITHREADED AND GEANT4_USE_TBB)
0043 list(APPEND GEANT4_TEST_ENVIRONMENT G4RUN_MANAGER_TYPE=TBB)
0044 endif()
0045 endif()