瀏覽代碼

ENH: add a very simple framework test

Bill Hoffman 18 年之前
父節點
當前提交
b39d96dff8
共有 6 個文件被更改,包括 34 次插入0 次删除
  1. 9 0
      Source/CMakeLists.txt
  2. 11 0
      Tests/Framework/CMakeLists.txt
  3. 6 0
      Tests/Framework/bar.cxx
  4. 6 0
      Tests/Framework/foo.cxx
  5. 1 0
      Tests/Framework/foo.h
  6. 1 0
      Tests/Framework/foo2.h

+ 9 - 0
Source/CMakeLists.txt

@@ -1107,6 +1107,15 @@ IF(BUILD_TESTING)
       --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
       --test-command VSExternalInclude)
   ENDIF(${CMAKE_TEST_GENERATOR} MATCHES "Visual Studio")
+  ADD_TEST(FrameworkTest ${CMAKE_CTEST_COMMAND}
+      --build-and-test
+      "${CMake_SOURCE_DIR}/Tests/Framework"
+      "${CMake_BINARY_DIR}/Tests/Framework"
+      --build-two-config
+      --build-generator ${CMAKE_TEST_GENERATOR}
+      --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
+      --build-project Framework
+      --test-command bar)
 
   IF (APPLE AND CMAKE_COMPILER_IS_GNUCXX)
     SET(BundleTestInstallDir

+ 11 - 0
Tests/Framework/CMakeLists.txt

@@ -0,0 +1,11 @@
+project(Framework)
+add_library(foo SHARED foo.cxx)
+set_target_properties(foo PROPERTIES 
+                          FRAMEWORK TRUE
+                          FRAMEWORK_PUBLIC_HEADERS "foo.h;foo2.h"
+                          FRAMEWORK_VERSION ver2
+                          FRAMEWORK_RESOURCES ""
+#                          VERSION 1.2
+)
+add_executable(bar bar.cxx)
+target_link_libraries(bar foo)

+ 6 - 0
Tests/Framework/bar.cxx

@@ -0,0 +1,6 @@
+void foo();
+int main()
+{
+  foo();
+  return 0;
+}

+ 6 - 0
Tests/Framework/foo.cxx

@@ -0,0 +1,6 @@
+#include <stdio.h>
+
+void foo()
+{
+  printf("foo\n");
+}

+ 1 - 0
Tests/Framework/foo.h

@@ -0,0 +1 @@
+fooh

+ 1 - 0
Tests/Framework/foo2.h

@@ -0,0 +1 @@
+foo2h