diff options
author | Ken Martin <ken.martin@kitware.com> | 2007-05-31 14:29:13 (GMT) |
---|---|---|
committer | Ken Martin <ken.martin@kitware.com> | 2007-05-31 14:29:13 (GMT) |
commit | 2f07e8e8f8f4890eb489ab43eb111c839235179b (patch) | |
tree | fede0d9102c440e4c0df7548f25c3a535189cd8e /Tests | |
parent | 5a6a3cd8698b82afef98e4d46af8bba22ca56529 (diff) | |
download | CMake-2f07e8e8f8f4890eb489ab43eb111c839235179b.zip CMake-2f07e8e8f8f4890eb489ab43eb111c839235179b.tar.gz CMake-2f07e8e8f8f4890eb489ab43eb111c839235179b.tar.bz2 |
ENH: added new test for SourceFile objects and properties
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/CMakeLists.txt | 1 | ||||
-rw-r--r-- | Tests/Properties/CMakeLists.txt | 27 | ||||
-rw-r--r-- | Tests/Properties/SubDir/properties3.cxx | 9 | ||||
-rw-r--r-- | Tests/Properties/properties.h.in | 1 | ||||
-rw-r--r-- | Tests/Properties/properties2.h | 1 |
5 files changed, 39 insertions, 0 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 8b6fb87..120c528 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -46,6 +46,7 @@ IF(BUILD_TESTING) ADD_TEST_MACRO(LinkLine LinkLine) ADD_TEST_MACRO(MacroTest miniMacroTest) ADD_TEST_MACRO(Framework bar) + ADD_TEST_MACRO(Properties Properties) # add tests with more complex invocations ADD_TEST(TargetName ${CMAKE_CTEST_COMMAND} diff --git a/Tests/Properties/CMakeLists.txt b/Tests/Properties/CMakeLists.txt new file mode 100644 index 0000000..d67f3ee --- /dev/null +++ b/Tests/Properties/CMakeLists.txt @@ -0,0 +1,27 @@ +# a simple CXX only test case +project (Properties) + +# these first three tests really test both properties and the management of +# cmSourceFile objects by CMake. + +# test properties on a build tree file that is relative (yuck) +configure_file(properties.h.in "${Properties_BINARY_DIR}/properties.h") +set_source_files_properties(properties.h PROPERTIES TEST1 1) +get_source_file_property(RESULT1 properties.h TEST1) + +# test properties on a headerfile in the source tree +# accessed without an extenion (also yuck) +set_source_files_properties(properties2 PROPERTIES TEST2 1) +get_source_file_property(RESULT2 properties2 TEST2) + +# test properties on a relative source that is not generated +set_source_files_properties(SubDir/properties3.cxx PROPERTIES TEST3 1) +get_source_file_property(RESULT3 SubDir/properties3.cxx TEST3) + +include_directories("${Properties_SOURCE_DIR}" "${Properties_BINARY_DIR}") + +if (RESULT1 AND RESULT2 AND RESULT3) + add_executable (Properties SubDir/properties3.cxx) +else (RESULT1 AND RESULT2 AND RESULT3) + message("Error: test results are TEST1=${TEST1} TEST2=${TEST2} TEST3=${TEST3}") +endif (RESULT1 AND RESULT2 AND RESULT3) diff --git a/Tests/Properties/SubDir/properties3.cxx b/Tests/Properties/SubDir/properties3.cxx new file mode 100644 index 0000000..1a27a04 --- /dev/null +++ b/Tests/Properties/SubDir/properties3.cxx @@ -0,0 +1,9 @@ +#include "properties.h" +#include "properties2.h" + +#if defined HAVE_PROPERTIES_H && defined HAVE_PROPERTIES2_H +int main () +{ + return 0; +} +#endif diff --git a/Tests/Properties/properties.h.in b/Tests/Properties/properties.h.in new file mode 100644 index 0000000..5e92831 --- /dev/null +++ b/Tests/Properties/properties.h.in @@ -0,0 +1 @@ +#define HAVE_PROPERTIES_H diff --git a/Tests/Properties/properties2.h b/Tests/Properties/properties2.h new file mode 100644 index 0000000..898fd9e --- /dev/null +++ b/Tests/Properties/properties2.h @@ -0,0 +1 @@ +#define HAVE_PROPERTIES2_H |