Browse Source

Fix for CTest in versions 3.14 and greater

iss7
Trevor Irons 5 years ago
parent
commit
f0e7ddc6e5
3 changed files with 21 additions and 19 deletions
  1. 13
    13
      CMakeLists.txt
  2. 5
    3
      CTestConfig.cmake
  3. 3
    3
      Modules/FDEM1D/testing/CMakeLists.txt

+ 13
- 13
CMakeLists.txt View File

@@ -177,13 +177,6 @@ set(CMAKE_MACOSX_RPATH 1)
177 177
 
178 178
 project (Lemma CXX)
179 179
 
180
-if(CXXTEST_FOUND)
181
-	if (LEMMA_ENABLE_TESTING)
182
-        include (CTest)
183
-    	enable_testing()
184
-	endif()
185
-endif()
186
-
187 180
 # Disallow in-source build
188 181
 if ("${Lemma_SOURCE_DIR}"  STREQUAL "${Lemma_BINARY_DIR}")
189 182
   message(FATAL_ERROR
@@ -191,6 +184,13 @@ if ("${Lemma_SOURCE_DIR}"  STREQUAL "${Lemma_BINARY_DIR}")
191 184
     "Please create a separate binary directory and run CMake there.")
192 185
 endif()
193 186
 
187
+if(CXXTEST_FOUND)
188
+	if (LEMMA_ENABLE_TESTING)
189
+        include (CTest)
190
+    	enable_testing()
191
+	endif()
192
+endif()
193
+
194 194
 ##############################
195 195
 # required external programs # for downloading packages
196 196
 ##############################
@@ -313,12 +313,12 @@ add_subdirectory (Modules)
313 313
 
314 314
 #######################################################################
315 315
 # CXXTEST Framework
316
-#if(CXXTEST_FOUND)
317
-#	if (LEMMA_ENABLE_TESTING)
318
-#        include (CTest)
319
-    	#enable_testing()
320
-#	endif()
321
-#endif()
316
+if(CXXTEST_FOUND)
317
+	if (LEMMA_ENABLE_TESTING)
318
+        include (CTest)
319
+    	enable_testing()
320
+	endif()
321
+endif()
322 322
 
323 323
 ########################################################################
324 324
 # add a target to generate API documentation with Doxyfile.in 

+ 5
- 3
CTestConfig.cmake View File

@@ -2,8 +2,9 @@
2 2
 ## Then modify the CMakeLists.txt file in the root directory of your
3 3
 ## project to incorporate the testing dashboard.
4 4
 ## # The following are required to uses Dart and the Cdash dashboard
5
-##   ENABLE_TESTING()
6
-##   INCLUDE(CTest)
5
+ENABLE_TESTING()
6
+#INCLUDE(CTest)
7
+
7 8
 set(CTEST_PROJECT_NAME "Lemma")
8 9
 set(CTEST_NIGHTLY_START_TIME "01:00:00 UTC")
9 10
 
@@ -11,4 +12,5 @@ set(CTEST_DROP_METHOD "http")
11 12
 set(CTEST_DROP_SITE "my.cdash.org")
12 13
 set(CTEST_DROP_LOCATION "/submit.php?project=Lemma")
13 14
 set(CTEST_DROP_SITE_CDASH TRUE)
14
-
15
+# CTest 3.14 requires this
16
+set(CTEST_SUBMIT_URL "my.cdash.org/submit.php?project=Lemma")

+ 3
- 3
Modules/FDEM1D/testing/CMakeLists.txt View File

@@ -6,12 +6,12 @@ target_link_libraries(unittest_FEM1D_GetNameCheck "lemmacore" "fdem1d" "yaml-cpp
6 6
 CXXTEST_ADD_TEST(unittest_FEM1D_SerializeCheck SerializeCheck.cc ${CMAKE_CURRENT_SOURCE_DIR}/SerializeCheck.h)
7 7
 target_link_libraries(unittest_FEM1D_SerializeCheck "lemmacore" "fdem1d" "yaml-cpp")
8 8
 
9
-CXXTEST_ADD_TEST(benchKiHa BenchKiHa.cc ${CMAKE_CURRENT_SOURCE_DIR}/BenchKiHa.h)
10
-target_link_libraries(benchKiHa "lemmacore" "fdem1d" "yaml-cpp")
9
+#CXXTEST_ADD_TEST(benchKiHa BenchKiHa.cc ${CMAKE_CURRENT_SOURCE_DIR}/BenchKiHa.h)
10
+#target_link_libraries(benchKiHa "lemmacore" "fdem1d" "yaml-cpp")
11 11
 
12 12
 set_target_properties(unittest_FEM1D_GetNameCheck
13 13
 	                  unittest_FEM1D_SerializeCheck 
14
-                      benchKiHa
14
+#                      benchKiHa
15 15
     PROPERTIES 
16 16
 	CXX_STANDARD 14
17 17
 	CXX_STANDARD_REQUIRED ON

Loading…
Cancel
Save