From b39d96dff85d9fe8b236f9519f5d7d9b8c9f2880 Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Tue, 8 May 2007 10:58:35 -0400 Subject: [PATCH] ENH: add a very simple framework test --- Source/CMakeLists.txt | 9 +++++++++ Tests/Framework/CMakeLists.txt | 11 +++++++++++ Tests/Framework/bar.cxx | 6 ++++++ Tests/Framework/foo.cxx | 6 ++++++ Tests/Framework/foo.h | 1 + Tests/Framework/foo2.h | 1 + 6 files changed, 34 insertions(+) create mode 100644 Tests/Framework/CMakeLists.txt create mode 100644 Tests/Framework/bar.cxx create mode 100644 Tests/Framework/foo.cxx create mode 100644 Tests/Framework/foo.h create mode 100644 Tests/Framework/foo2.h diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index be55bb286..720963ce1 100644 --- a/Source/CMakeLists.txt +++ b/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 diff --git a/Tests/Framework/CMakeLists.txt b/Tests/Framework/CMakeLists.txt new file mode 100644 index 000000000..3aac24dfe --- /dev/null +++ b/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) diff --git a/Tests/Framework/bar.cxx b/Tests/Framework/bar.cxx new file mode 100644 index 000000000..37c132a0f --- /dev/null +++ b/Tests/Framework/bar.cxx @@ -0,0 +1,6 @@ +void foo(); +int main() +{ + foo(); + return 0; +} diff --git a/Tests/Framework/foo.cxx b/Tests/Framework/foo.cxx new file mode 100644 index 000000000..62acbb77c --- /dev/null +++ b/Tests/Framework/foo.cxx @@ -0,0 +1,6 @@ +#include + +void foo() +{ + printf("foo\n"); +} diff --git a/Tests/Framework/foo.h b/Tests/Framework/foo.h new file mode 100644 index 000000000..d959c813f --- /dev/null +++ b/Tests/Framework/foo.h @@ -0,0 +1 @@ +fooh diff --git a/Tests/Framework/foo2.h b/Tests/Framework/foo2.h new file mode 100644 index 000000000..2431d7980 --- /dev/null +++ b/Tests/Framework/foo2.h @@ -0,0 +1 @@ +foo2h