Sfoglia il codice sorgente

ENH: add test for conv libraries

Bill Hoffman 19 anni fa
parent
commit
303048d3dc
2 ha cambiato i file con 29 aggiunte e 19 eliminazioni
  1. 10 0
      Source/CMakeLists.txt
  2. 19 19
      Tests/ConvLibrary/CMakeLists.txt

+ 10 - 0
Source/CMakeLists.txt

@@ -697,6 +697,16 @@ IF(BUILD_TESTING)
       -DCMAKE_TEST_SYSTEM_LIBRARIES:BOOL=${CMAKE_TEST_SYSTEM_LIBRARIES}
       --test-command complex)
 
+    ADD_TEST(ConvLibrary ${CMAKE_CTEST_COMMAND}
+      --build-and-test
+      "${CMake_SOURCE_DIR}/Tests/ConvLibrary"
+      "${CMake_BINARY_DIR}/Tests/ConvLibrary/Step4"
+      --build-two-config
+      --build-generator ${CMAKE_TEST_GENERATOR}
+      --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
+      --build-project ConvLibrary
+      --test-command bartest)
+
 #    ADD_TEST(complexRelativePaths  ${CMAKE_CTEST_COMMAND}
 #      --build-and-test
 #      "${CMake_SOURCE_DIR}/Tests/ComplexRelativePaths"

+ 19 - 19
Tests/ConvLibrary/CMakeLists.txt

@@ -1,19 +1,19 @@
-project(foo)
-
-# create a source list
-set(foo_sources foo.cxx bar.c sub1/car.cxx) 
-# create a library foo from the sources
-add_library(foo ${foo_sources})
-# get the object files from the target
-get_target_property(OBJECT_FILES foo OBJECT_FILES)
-message("${OBJECT_FILES}")
-# set the object files as generated
-set_source_files_properties(${OBJECT_FILES} PROPERTIES GENERATED true)
-# create a library bar that contains the object files from foo
-add_library(bar ${OBJECT_FILES})
-# set the linker language since bar only has .obj
-set_target_properties(bar PROPERTIES LINKER_LANGUAGE CXX)
-# make sure foo is built before bar
-add_dependencies(bar foo)
-add_executable(bartest bartest.cxx)
-target_link_libraries(bartest bar)
+project(ConvLibrary)
+
+# create a source list
+set(foo_sources foo.cxx bar.c sub1/car.cxx) 
+# create a library foo from the sources
+add_library(foo ${foo_sources})
+# get the object files from the target
+get_target_property(OBJECT_FILES foo OBJECT_FILES)
+message("${OBJECT_FILES}")
+# set the object files as generated
+set_source_files_properties(${OBJECT_FILES} PROPERTIES GENERATED true)
+# create a library bar that contains the object files from foo
+add_library(bar ${OBJECT_FILES})
+# set the linker language since bar only has .obj
+set_target_properties(bar PROPERTIES LINKER_LANGUAGE CXX)
+# make sure foo is built before bar
+add_dependencies(bar foo)
+add_executable(bartest bartest.cxx)
+target_link_libraries(bartest bar)