Back to home page

EIC code displayed by LXR

 
 

    


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   include(G4TestAPI)
0018 
0019   # - Geant4_DIR is needed to locate GeantConfig.cmake file required
0020   # for tests and examples that are built as direct subprojects
0021   # (as opposed to "build-and-test" type situations)
0022   set(Geant4_DIR ${PROJECT_BINARY_DIR})
0023 
0024   # - Base URL for test reference files
0025   set(GEANT4_TEST_REFERENCES_URL "http://cern.ch/geant4-data/stt/references/")
0026 
0027   # - Add datasets to testing environment
0028   geant4_get_datasetnames(_dslist)
0029   foreach(_ds ${_dslist})
0030     geant4_get_dataset_property(${_ds} ENVVAR _dsenvvar)
0031     geant4_get_dataset_property(${_ds} BUILD_DIR _dspath)
0032     list(APPEND GEANT4_TEST_ENVIRONMENT ${_dsenvvar}=${_dspath})
0033   endforeach()
0034 
0035   # - Add TOOLS_FONT_PATH to testing environment if required
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 if required
0042   if(GEANT4_BUILD_MULTITHREADED AND GEANT4_USE_TBB)
0043     list(APPEND GEANT4_TEST_ENVIRONMENT G4RUN_MANAGER_TYPE=TBB)
0044   endif()
0045 endif()