@@ -9,9 +9,6 @@ option(MeshFields_USE_Cabana "Build with the Cabana storage backend" OFF)
99
1010find_package (Kokkos REQUIRED)
1111find_package (Omega_h REQUIRED)
12- #Clear the omegah compilation flags that it passes to cuda. Using the
13- # kokkos target, and nvcc_wrapper, provide sufficient flags.
14- set_property (TARGET Omega_h::omega_h PROPERTY INTERFACE_COMPILE_OPTIONS "" )
1512
1613if (MeshFields_USE_Cabana)
1714 find_package (Cabana 0.7.0 REQUIRED)
@@ -112,8 +109,8 @@ endif()
112109enable_testing ()
113110include (CTest)
114111
115- option (IS_TESTING "Build for CTest" OFF )
116- message (STATUS "IS_TESTING : ${IS_TESTING } " )
112+ option (MeshFields_IS_TESTING "Build for CTest" OFF )
113+ message (STATUS "MeshFields_IS_TESTING : ${MeshFields_IS_TESTING } " )
117114
118115#check for valgrind
119116find_program (VALGRIND_CMD valgrind DOC "Location of the valgrind program" )
@@ -124,72 +121,87 @@ function(test_func_impl TEST_NAME)
124121 # need to run as a cmake script to capture assert and other 'system failures'
125122 # https://cmake.org/cmake/help/latest/prop_test/WILL_FAIL.html#prop_test:WILL_FAIL
126123 add_test (NAME ${TEST_NAME} COMMAND ${CMAKE_COMMAND} -E env ${TEST_STR} )
124+ if (TEST ${TEST_NAME} )
125+ set_property (TEST ${TEST_NAME} PROPERTY LABELS "meshfields::base" )
126+ endif ()
127127endfunction (test_func_impl)
128128
129- function (test_func TEST_NAME)
129+ #smoke tests that are always enabled
130+ function (smoke_test_func TEST_NAME)
130131 test_func_impl(${TEST_NAME} ${ARGN} )
131132 if (TEST ${TEST_NAME} )
132- set_property (TEST ${TEST_NAME} PROPERTY LABELS "base" )
133+ set_property (TEST ${TEST_NAME} PROPERTY LABELS "meshfields::smoke" )
134+ endif ()
135+ endfunction (smoke_test_func)
136+
137+ function (test_func TEST_NAME)
138+ if (MeshFields_IS_TESTING)
139+ test_func_impl(${TEST_NAME} ${ARGN} )
133140 endif ()
134141endfunction (test_func)
135142
136143# Unlike test_func, will_fail_test_func assumes the command for the test will fail
137144function (will_fail_test_func TEST_NAME)
138- test_func_impl(${TEST_NAME} ${ARGN} )
139- set_property (TEST ${TEST_NAME} PROPERTY WILL_FAIL TRUE )
140- if (TEST ${TEST_NAME} )
141- set_property (TEST ${TEST_NAME} PROPERTY LABELS "base" )
145+ if (MeshFields_IS_TESTING)
146+ test_func_impl(${TEST_NAME} ${ARGN} )
147+ set_property (TEST ${TEST_NAME} PROPERTY WILL_FAIL TRUE )
142148 endif ()
143149endfunction ()
144150
145151function (will_fail_valgrind_test_func TEST_NAME)
146- if (VALGRIND_CMD)
147- test_func_impl(${TEST_NAME} ${VALGRIND_CMD} ${ARGN} )
148- set_property (TEST ${TEST_NAME} PROPERTY
149- FAIL_REGULAR_EXPRESSION "Invalid read;Invalid write"
150- )
151- set_property (TEST ${TEST_NAME} PROPERTY WILL_FAIL TRUE )
152- if (TEST ${TEST_NAME} )
153- set_property (TEST ${TEST_NAME} PROPERTY LABELS "base" )
152+ if (MeshFields_IS_TESTING)
153+ if (VALGRIND_CMD)
154+ test_func_impl(${TEST_NAME} ${VALGRIND_CMD} ${ARGN} )
155+ set_property (TEST ${TEST_NAME} PROPERTY
156+ FAIL_REGULAR_EXPRESSION "Invalid read;Invalid write"
157+ )
158+ set_property (TEST ${TEST_NAME} PROPERTY WILL_FAIL TRUE )
154159 endif ()
155160 endif ()
156161endfunction ()
157162
158- function (meshfields_add_exe EXE_NAME EXE_SRC)
163+ #smoke executables are always built
164+ function (meshfields_add_smoke_exe EXE_NAME EXE_SRC)
159165 add_executable (${EXE_NAME} ${EXE_SRC} )
160166 target_link_libraries (${EXE_NAME} PRIVATE meshfields)
161167endfunction ()
162168
163- # Creating minimal reproduction of error
164- meshfields_add_exe(KokkosTests test /testKokkos.cpp)
169+ function (meshfields_add_exe EXE_NAME EXE_SRC)
170+ if (MeshFields_IS_TESTING)
171+ add_executable (${EXE_NAME} ${EXE_SRC} )
172+ target_link_libraries (${EXE_NAME} PRIVATE meshfields)
173+ endif ()
174+ endfunction ()
175+
176+ meshfields_add_smoke_exe(KokkosTests test /testKokkos.cpp)
165177meshfields_add_exe(SerializationTests test /testSerialize.cpp)
166178meshfields_add_exe(ElementTests test /testElement.cpp)
167179meshfields_add_exe(ElementJacobian1d test /testElementJacobian1d.cpp)
168180meshfields_add_exe(ElementJacobian2d test /testElementJacobian2d.cpp)
169181meshfields_add_exe(ElementJacobian3d test /testElementJacobian3d.cpp)
170182meshfields_add_exe(CountIntegrator test /testCountIntegrator.cpp)
171- meshfields_add_exe (OmegahTriTests test /testOmegahTri.cpp)
183+ meshfields_add_smoke_exe (OmegahTriTests test /testOmegahTri.cpp)
172184meshfields_add_exe(ExceptionTest test /testExceptions.cpp)
173185meshfields_add_exe(PointMapping test /testPointMapping.cpp)
174186meshfields_add_exe(OmegahTetTest test /testOmegahTet.cpp)
175187
176188if (MeshFields_USE_Cabana)
177189 meshfields_add_exe(ControllerPerformance test /testControllerPerformance.cpp)
178- meshfields_add_exe (CabanaTests test /testCabana.cpp)
179- test_func (CabanaTests ./CabanaTests)
190+ meshfields_add_smoke_exe (CabanaTests test /testCabana.cpp)
191+ smoke_test_func (CabanaTests ./CabanaTests)
180192 test_func(ControllerPerformance ./ControllerPerformance)
181193endif ()
182194
183- test_func (KokkosTests ./KokkosTests)
195+ smoke_test_func (KokkosTests ./KokkosTests)
184196test_func(SerializationTests ./SerializationTests)
185197test_func(ElementTests ./ElementTests)
186198test_func(ElementJacobian1d ./ElementJacobian1d)
187199test_func(ElementJacobian2d ./ElementJacobian2d)
188200test_func(ElementJacobian3d ./ElementJacobian3d)
189201test_func(CountIntegrator ./CountIntegrator)
190- test_func (OmegahTriTests ./OmegahTriTests)
202+ smoke_test_func (OmegahTriTests ./OmegahTriTests)
191203test_func(PointMapping ./PointMapping)
192- test_func(OmegahTetTest, ./OmegahTetTest)
204+ test_func(OmegahTetTest ./OmegahTetTest)
193205if (MeshFields_USE_EXCEPTIONS)
194206 # exception caught - no error
195207 test_func(ExceptionTest ./ExceptionTest)
0 commit comments