Преглед изворни кода

ENH: try to get better test coverage

Bill Hoffman пре 24 година
родитељ
комит
3a3b55679b
39 измењених фајлова са 570 додато и 0 уклоњено
  1. 26 0
      Tests/Complex/CMakeLists.txt
  2. 4 0
      Tests/Complex/Executable/CMakeLists.txt
  3. 104 0
      Tests/Complex/Executable/complex.cxx
  4. 8 0
      Tests/Complex/Library/CMakeLists.txt
  5. 4 0
      Tests/Complex/Library/ExtraSources/file1.cxx
  6. 1 0
      Tests/Complex/Library/ExtraSources/file1.h
  7. 4 0
      Tests/Complex/Library/file2.cxx
  8. 1 0
      Tests/Complex/Library/file2.h
  9. 6 0
      Tests/Complex/Library/sharedFile.cxx
  10. 12 0
      Tests/Complex/Library/sharedFile.h
  11. 11 0
      Tests/Complex/VarTests.txt
  12. 5 0
      Tests/Complex/cmTestConfigure.h.in
  13. 4 0
      Tests/Complex/simple.cxx
  14. 26 0
      Tests/ComplexOneConfig/CMakeLists.txt
  15. 4 0
      Tests/ComplexOneConfig/Executable/CMakeLists.txt
  16. 104 0
      Tests/ComplexOneConfig/Executable/complex.cxx
  17. 8 0
      Tests/ComplexOneConfig/Library/CMakeLists.txt
  18. 4 0
      Tests/ComplexOneConfig/Library/ExtraSources/file1.cxx
  19. 1 0
      Tests/ComplexOneConfig/Library/ExtraSources/file1.h
  20. 4 0
      Tests/ComplexOneConfig/Library/file2.cxx
  21. 1 0
      Tests/ComplexOneConfig/Library/file2.h
  22. 6 0
      Tests/ComplexOneConfig/Library/sharedFile.cxx
  23. 12 0
      Tests/ComplexOneConfig/Library/sharedFile.h
  24. 11 0
      Tests/ComplexOneConfig/VarTests.txt
  25. 5 0
      Tests/ComplexOneConfig/cmTestConfigure.h.in
  26. 4 0
      Tests/ComplexOneConfig/simple.cxx
  27. 26 0
      Tests/ComplexRelativePaths/CMakeLists.txt
  28. 4 0
      Tests/ComplexRelativePaths/Executable/CMakeLists.txt
  29. 104 0
      Tests/ComplexRelativePaths/Executable/complex.cxx
  30. 8 0
      Tests/ComplexRelativePaths/Library/CMakeLists.txt
  31. 4 0
      Tests/ComplexRelativePaths/Library/ExtraSources/file1.cxx
  32. 1 0
      Tests/ComplexRelativePaths/Library/ExtraSources/file1.h
  33. 4 0
      Tests/ComplexRelativePaths/Library/file2.cxx
  34. 1 0
      Tests/ComplexRelativePaths/Library/file2.h
  35. 6 0
      Tests/ComplexRelativePaths/Library/sharedFile.cxx
  36. 12 0
      Tests/ComplexRelativePaths/Library/sharedFile.h
  37. 11 0
      Tests/ComplexRelativePaths/VarTests.txt
  38. 5 0
      Tests/ComplexRelativePaths/cmTestConfigure.h.in
  39. 4 0
      Tests/ComplexRelativePaths/simple.cxx

+ 26 - 0
Tests/Complex/CMakeLists.txt

@@ -0,0 +1,26 @@
+# a simple test case
+PROJECT (Complex)
+
+ADD_DEFINITIONS(-DCMAKE_IS_FUN)
+SUBDIRS(Library Executable)
+SUBDIR_DEPENDS(Executable Library)
+
+INCLUDE(${Complex_SOURCE_DIR}/VarTests.txt)
+
+CONFIGURE_FILE(
+${Complex_SOURCE_DIR}/cmTestConfigure.h.in
+${Complex_BINARY_DIR}/cmTestConfigure.h)
+
+INCLUDE_DIRECTORIES(
+${Complex_BINARY_DIR}
+${Complex_SOURCE_DIR}/Library
+${Complex_SOURCE_DIR}/../../Source
+)
+LINK_DIRECTORIES(
+${Complex_BINARY_DIR}/Library
+)
+
+INCLUDE_REGULAR_EXPRESSION("^(cmTest|file|sharedFile).*$")
+
+SET (LIBRARY_OUTPUT_PATH ${Complex_BINARY_DIR}/bin/ CACHE PATH "Single output directory for building all libraries.")
+SET (EXECUTABLE_OUTPUT_PATH ${Complex_BINARY_DIR}/bin/ CACHE PATH "Single output directory for building all executables.")

+ 4 - 0
Tests/Complex/Executable/CMakeLists.txt

@@ -0,0 +1,4 @@
+ADD_EXECUTABLE(complex complex)
+TARGET_LINK_LIBRARIES(complex CMakeTestLibrary)
+TARGET_LINK_LIBRARIES(complex CMakeTestLibraryShared)
+

+ 104 - 0
Tests/Complex/Executable/complex.cxx

@@ -0,0 +1,104 @@
+#include "cmTestConfigure.h"
+#include "ExtraSources/file1.h"
+#include "file2.h"
+#include "sharedFile.h"
+#include "cmStandardIncludes.h"
+
+int passed = 0;
+int failed = 0;
+
+void Failed(const char* Message, const char* m2= "")
+{
+  std::cerr << "Failed: " << Message << m2 << "\n"; 
+  failed++;
+}
+
+void Passed(const char* Message, const char* m2="")
+{
+  std::cout << "Passed: " << Message << m2 << "\n"; 
+  passed++;
+}
+
+main()
+{
+  if(sharedFunction() != 1)
+    {
+    Failed("Call to sharedFunction from shared library failed.");
+    }
+  else
+    {
+    Passed("Call to sharedFunction from shared library worked.");
+    }
+  
+  if(file1() != 1)
+    {
+    Failed("Call to file1 function from library failed.");
+    }
+  else
+    {
+    Passed("Call to file1 function returned 1.");
+    }
+  if(file2() != 1)
+    {
+    Failed("Call to file2 function from library failed.");
+    }
+  else
+    {
+    Passed("Call to file2 function returned 1.");
+    }
+#ifndef CMAKE_IS_FUN
+  Failed("CMake is not fun, so it is broken and should be fixed.");
+#else
+  Passed("CMAKE_IS_FUN is defined.");
+#endif
+  
+#ifdef SHOULD_NOT_BE_DEFINED
+  Failed("IF or SET is broken, SHOULD_NOT_BE_DEFINED is defined.");
+#else
+  Passed("SHOULD_NOT_BE_DEFINED is not defined.");
+#endif
+  
+#ifndef SHOULD_BE_DEFINED
+  Failed("IF or SET is broken, SHOULD_BE_DEFINED is not defined.\n");
+#else
+  Passed("SHOULD_BE_DEFINED is defined.");
+#endif
+  
+#ifndef ONE_VAR
+  Failed("cmakedefine is broken, ONE_VAR is not defined.");
+#else
+  Passed("ONE_VAR is defined.");
+#endif
+  
+#ifdef ZERO_VAR
+  Failed("cmakedefine is broken, ZERO_VAR is defined.");
+#else
+  Passed("ZERO_VAR is not defined.");
+#endif
+  
+
+  
+#ifndef STRING_VAR
+  Failed("configureFile is broken, STRING_VAR is not defined.");
+#else
+  if(strcmp(STRING_VAR, "CMake is great") != 0)
+    {
+    Failed("CMake is not great, so the SET command,"
+           "or the configurefile comand is broken.  STRING_VAR== ", 
+           STRING_VAR);
+    }
+  else
+    {
+    Passed("STRING_VAR == ", STRING_VAR);
+    }
+#endif
+  std::cout << "Passed:" << passed << "\n";
+  if(failed)
+    {
+    std::cout << "Failed: " << failed << "\n";
+    return failed;
+    }
+  return 0;
+}
+
+  

+ 8 - 0
Tests/Complex/Library/CMakeLists.txt

@@ -0,0 +1,8 @@
+AUX_SOURCE_DIRECTORY(ExtraSources LibrarySources)
+
+SOURCE_FILES(LibrarySources file2)
+ADD_LIBRARY(CMakeTestLibrary LibrarySources)
+SOURCE_FILES(SharedLibrarySources sharedFile)
+ADD_LIBRARY(CMakeTestLibraryShared SHARED SharedLibrarySources)
+
+

+ 4 - 0
Tests/Complex/Library/ExtraSources/file1.cxx

@@ -0,0 +1,4 @@
+int file1()
+{
+  return 1;
+}

+ 1 - 0
Tests/Complex/Library/ExtraSources/file1.h

@@ -0,0 +1 @@
+int file1();

+ 4 - 0
Tests/Complex/Library/file2.cxx

@@ -0,0 +1,4 @@
+int file2()
+{
+  return 1;
+}

+ 1 - 0
Tests/Complex/Library/file2.h

@@ -0,0 +1 @@
+int file2();

+ 6 - 0
Tests/Complex/Library/sharedFile.cxx

@@ -0,0 +1,6 @@
+#include "sharedFile.h"
+
+int sharedFunction()
+{
+  return 1;
+}

+ 12 - 0
Tests/Complex/Library/sharedFile.h

@@ -0,0 +1,12 @@
+#if defined(_WIN32) || defined(WIN32) /* Win32 version */
+#ifdef CMakeTestLibraryShared_EXPORTS
+#  define CMakeTest_EXPORT __declspec(dllexport)
+#else
+#  define CMakeTest_EXPORT __declspec(dllimport)
+#endif
+#else
+// unix needs nothing
+#define CMakeTest_EXPORT
+#endif
+
+CMakeTest_EXPORT int sharedFunction();

+ 11 - 0
Tests/Complex/VarTests.txt

@@ -0,0 +1,11 @@
+
+SET (ZERO_VAR 0)
+IF(ZERO_VAR)
+ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED)
+ELSE(ZERO_VAR)
+ADD_DEFINITIONS(-DSHOULD_BE_DEFINED)
+ENDIF(ZERO_VAR)
+
+SET(ONE_VAR 1)
+
+SET(STRING_VAR "CMake is great" CACHE STRING "test a cache variable")

+ 5 - 0
Tests/Complex/cmTestConfigure.h.in

@@ -0,0 +1,5 @@
+#cmakedefine ONE_VAR
+#cmakedefine ZERO_VAR
+#define STRING_VAR "${STRING_VAR}"
+
+

+ 4 - 0
Tests/Complex/simple.cxx

@@ -0,0 +1,4 @@
+int main ()
+{
+  return 0;
+}

+ 26 - 0
Tests/ComplexOneConfig/CMakeLists.txt

@@ -0,0 +1,26 @@
+# a simple test case
+PROJECT (Complex)
+
+ADD_DEFINITIONS(-DCMAKE_IS_FUN)
+SUBDIRS(Library Executable)
+SUBDIR_DEPENDS(Executable Library)
+
+INCLUDE(${Complex_SOURCE_DIR}/VarTests.txt)
+
+CONFIGURE_FILE(
+${Complex_SOURCE_DIR}/cmTestConfigure.h.in
+${Complex_BINARY_DIR}/cmTestConfigure.h)
+
+INCLUDE_DIRECTORIES(
+${Complex_BINARY_DIR}
+${Complex_SOURCE_DIR}/Library
+${Complex_SOURCE_DIR}/../../Source
+)
+LINK_DIRECTORIES(
+${Complex_BINARY_DIR}/Library
+)
+
+INCLUDE_REGULAR_EXPRESSION("^(cmTest|file|sharedFile).*$")
+
+SET (LIBRARY_OUTPUT_PATH ${Complex_BINARY_DIR}/bin/ CACHE PATH "Single output directory for building all libraries.")
+SET (EXECUTABLE_OUTPUT_PATH ${Complex_BINARY_DIR}/bin/ CACHE PATH "Single output directory for building all executables.")

+ 4 - 0
Tests/ComplexOneConfig/Executable/CMakeLists.txt

@@ -0,0 +1,4 @@
+ADD_EXECUTABLE(complex complex)
+TARGET_LINK_LIBRARIES(complex CMakeTestLibrary)
+TARGET_LINK_LIBRARIES(complex CMakeTestLibraryShared)
+

+ 104 - 0
Tests/ComplexOneConfig/Executable/complex.cxx

@@ -0,0 +1,104 @@
+#include "cmTestConfigure.h"
+#include "ExtraSources/file1.h"
+#include "file2.h"
+#include "sharedFile.h"
+#include "cmStandardIncludes.h"
+
+int passed = 0;
+int failed = 0;
+
+void Failed(const char* Message, const char* m2= "")
+{
+  std::cerr << "Failed: " << Message << m2 << "\n"; 
+  failed++;
+}
+
+void Passed(const char* Message, const char* m2="")
+{
+  std::cout << "Passed: " << Message << m2 << "\n"; 
+  passed++;
+}
+
+main()
+{
+  if(sharedFunction() != 1)
+    {
+    Failed("Call to sharedFunction from shared library failed.");
+    }
+  else
+    {
+    Passed("Call to sharedFunction from shared library worked.");
+    }
+  
+  if(file1() != 1)
+    {
+    Failed("Call to file1 function from library failed.");
+    }
+  else
+    {
+    Passed("Call to file1 function returned 1.");
+    }
+  if(file2() != 1)
+    {
+    Failed("Call to file2 function from library failed.");
+    }
+  else
+    {
+    Passed("Call to file2 function returned 1.");
+    }
+#ifndef CMAKE_IS_FUN
+  Failed("CMake is not fun, so it is broken and should be fixed.");
+#else
+  Passed("CMAKE_IS_FUN is defined.");
+#endif
+  
+#ifdef SHOULD_NOT_BE_DEFINED
+  Failed("IF or SET is broken, SHOULD_NOT_BE_DEFINED is defined.");
+#else
+  Passed("SHOULD_NOT_BE_DEFINED is not defined.");
+#endif
+  
+#ifndef SHOULD_BE_DEFINED
+  Failed("IF or SET is broken, SHOULD_BE_DEFINED is not defined.\n");
+#else
+  Passed("SHOULD_BE_DEFINED is defined.");
+#endif
+  
+#ifndef ONE_VAR
+  Failed("cmakedefine is broken, ONE_VAR is not defined.");
+#else
+  Passed("ONE_VAR is defined.");
+#endif
+  
+#ifdef ZERO_VAR
+  Failed("cmakedefine is broken, ZERO_VAR is defined.");
+#else
+  Passed("ZERO_VAR is not defined.");
+#endif
+  
+
+  
+#ifndef STRING_VAR
+  Failed("configureFile is broken, STRING_VAR is not defined.");
+#else
+  if(strcmp(STRING_VAR, "CMake is great") != 0)
+    {
+    Failed("CMake is not great, so the SET command,"
+           "or the configurefile comand is broken.  STRING_VAR== ", 
+           STRING_VAR);
+    }
+  else
+    {
+    Passed("STRING_VAR == ", STRING_VAR);
+    }
+#endif
+  std::cout << "Passed:" << passed << "\n";
+  if(failed)
+    {
+    std::cout << "Failed: " << failed << "\n";
+    return failed;
+    }
+  return 0;
+}
+
+  

+ 8 - 0
Tests/ComplexOneConfig/Library/CMakeLists.txt

@@ -0,0 +1,8 @@
+AUX_SOURCE_DIRECTORY(ExtraSources LibrarySources)
+
+SOURCE_FILES(LibrarySources file2)
+ADD_LIBRARY(CMakeTestLibrary LibrarySources)
+SOURCE_FILES(SharedLibrarySources sharedFile)
+ADD_LIBRARY(CMakeTestLibraryShared SHARED SharedLibrarySources)
+
+

+ 4 - 0
Tests/ComplexOneConfig/Library/ExtraSources/file1.cxx

@@ -0,0 +1,4 @@
+int file1()
+{
+  return 1;
+}

+ 1 - 0
Tests/ComplexOneConfig/Library/ExtraSources/file1.h

@@ -0,0 +1 @@
+int file1();

+ 4 - 0
Tests/ComplexOneConfig/Library/file2.cxx

@@ -0,0 +1,4 @@
+int file2()
+{
+  return 1;
+}

+ 1 - 0
Tests/ComplexOneConfig/Library/file2.h

@@ -0,0 +1 @@
+int file2();

+ 6 - 0
Tests/ComplexOneConfig/Library/sharedFile.cxx

@@ -0,0 +1,6 @@
+#include "sharedFile.h"
+
+int sharedFunction()
+{
+  return 1;
+}

+ 12 - 0
Tests/ComplexOneConfig/Library/sharedFile.h

@@ -0,0 +1,12 @@
+#if defined(_WIN32) || defined(WIN32) /* Win32 version */
+#ifdef CMakeTestLibraryShared_EXPORTS
+#  define CMakeTest_EXPORT __declspec(dllexport)
+#else
+#  define CMakeTest_EXPORT __declspec(dllimport)
+#endif
+#else
+// unix needs nothing
+#define CMakeTest_EXPORT
+#endif
+
+CMakeTest_EXPORT int sharedFunction();

+ 11 - 0
Tests/ComplexOneConfig/VarTests.txt

@@ -0,0 +1,11 @@
+
+SET (ZERO_VAR 0)
+IF(ZERO_VAR)
+ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED)
+ELSE(ZERO_VAR)
+ADD_DEFINITIONS(-DSHOULD_BE_DEFINED)
+ENDIF(ZERO_VAR)
+
+SET(ONE_VAR 1)
+
+SET(STRING_VAR "CMake is great" CACHE STRING "test a cache variable")

+ 5 - 0
Tests/ComplexOneConfig/cmTestConfigure.h.in

@@ -0,0 +1,5 @@
+#cmakedefine ONE_VAR
+#cmakedefine ZERO_VAR
+#define STRING_VAR "${STRING_VAR}"
+
+

+ 4 - 0
Tests/ComplexOneConfig/simple.cxx

@@ -0,0 +1,4 @@
+int main ()
+{
+  return 0;
+}

+ 26 - 0
Tests/ComplexRelativePaths/CMakeLists.txt

@@ -0,0 +1,26 @@
+# a simple test case
+PROJECT (Complex)
+
+ADD_DEFINITIONS(-DCMAKE_IS_FUN)
+SUBDIRS(Library Executable)
+SUBDIR_DEPENDS(Executable Library)
+
+INCLUDE(${Complex_SOURCE_DIR}/VarTests.txt)
+
+CONFIGURE_FILE(
+${Complex_SOURCE_DIR}/cmTestConfigure.h.in
+${Complex_BINARY_DIR}/cmTestConfigure.h)
+
+INCLUDE_DIRECTORIES(
+${Complex_BINARY_DIR}
+${Complex_SOURCE_DIR}/Library
+${Complex_SOURCE_DIR}/../../Source
+)
+LINK_DIRECTORIES(
+${Complex_BINARY_DIR}/Library
+)
+
+INCLUDE_REGULAR_EXPRESSION("^(cmTest|file|sharedFile).*$")
+
+SET (LIBRARY_OUTPUT_PATH ${Complex_BINARY_DIR}/bin/ CACHE PATH "Single output directory for building all libraries.")
+SET (EXECUTABLE_OUTPUT_PATH ${Complex_BINARY_DIR}/bin/ CACHE PATH "Single output directory for building all executables.")

+ 4 - 0
Tests/ComplexRelativePaths/Executable/CMakeLists.txt

@@ -0,0 +1,4 @@
+ADD_EXECUTABLE(complex complex)
+TARGET_LINK_LIBRARIES(complex CMakeTestLibrary)
+TARGET_LINK_LIBRARIES(complex CMakeTestLibraryShared)
+

+ 104 - 0
Tests/ComplexRelativePaths/Executable/complex.cxx

@@ -0,0 +1,104 @@
+#include "cmTestConfigure.h"
+#include "ExtraSources/file1.h"
+#include "file2.h"
+#include "sharedFile.h"
+#include "cmStandardIncludes.h"
+
+int passed = 0;
+int failed = 0;
+
+void Failed(const char* Message, const char* m2= "")
+{
+  std::cerr << "Failed: " << Message << m2 << "\n"; 
+  failed++;
+}
+
+void Passed(const char* Message, const char* m2="")
+{
+  std::cout << "Passed: " << Message << m2 << "\n"; 
+  passed++;
+}
+
+main()
+{
+  if(sharedFunction() != 1)
+    {
+    Failed("Call to sharedFunction from shared library failed.");
+    }
+  else
+    {
+    Passed("Call to sharedFunction from shared library worked.");
+    }
+  
+  if(file1() != 1)
+    {
+    Failed("Call to file1 function from library failed.");
+    }
+  else
+    {
+    Passed("Call to file1 function returned 1.");
+    }
+  if(file2() != 1)
+    {
+    Failed("Call to file2 function from library failed.");
+    }
+  else
+    {
+    Passed("Call to file2 function returned 1.");
+    }
+#ifndef CMAKE_IS_FUN
+  Failed("CMake is not fun, so it is broken and should be fixed.");
+#else
+  Passed("CMAKE_IS_FUN is defined.");
+#endif
+  
+#ifdef SHOULD_NOT_BE_DEFINED
+  Failed("IF or SET is broken, SHOULD_NOT_BE_DEFINED is defined.");
+#else
+  Passed("SHOULD_NOT_BE_DEFINED is not defined.");
+#endif
+  
+#ifndef SHOULD_BE_DEFINED
+  Failed("IF or SET is broken, SHOULD_BE_DEFINED is not defined.\n");
+#else
+  Passed("SHOULD_BE_DEFINED is defined.");
+#endif
+  
+#ifndef ONE_VAR
+  Failed("cmakedefine is broken, ONE_VAR is not defined.");
+#else
+  Passed("ONE_VAR is defined.");
+#endif
+  
+#ifdef ZERO_VAR
+  Failed("cmakedefine is broken, ZERO_VAR is defined.");
+#else
+  Passed("ZERO_VAR is not defined.");
+#endif
+  
+
+  
+#ifndef STRING_VAR
+  Failed("configureFile is broken, STRING_VAR is not defined.");
+#else
+  if(strcmp(STRING_VAR, "CMake is great") != 0)
+    {
+    Failed("CMake is not great, so the SET command,"
+           "or the configurefile comand is broken.  STRING_VAR== ", 
+           STRING_VAR);
+    }
+  else
+    {
+    Passed("STRING_VAR == ", STRING_VAR);
+    }
+#endif
+  std::cout << "Passed:" << passed << "\n";
+  if(failed)
+    {
+    std::cout << "Failed: " << failed << "\n";
+    return failed;
+    }
+  return 0;
+}
+
+  

+ 8 - 0
Tests/ComplexRelativePaths/Library/CMakeLists.txt

@@ -0,0 +1,8 @@
+AUX_SOURCE_DIRECTORY(ExtraSources LibrarySources)
+
+SOURCE_FILES(LibrarySources file2)
+ADD_LIBRARY(CMakeTestLibrary LibrarySources)
+SOURCE_FILES(SharedLibrarySources sharedFile)
+ADD_LIBRARY(CMakeTestLibraryShared SHARED SharedLibrarySources)
+
+

+ 4 - 0
Tests/ComplexRelativePaths/Library/ExtraSources/file1.cxx

@@ -0,0 +1,4 @@
+int file1()
+{
+  return 1;
+}

+ 1 - 0
Tests/ComplexRelativePaths/Library/ExtraSources/file1.h

@@ -0,0 +1 @@
+int file1();

+ 4 - 0
Tests/ComplexRelativePaths/Library/file2.cxx

@@ -0,0 +1,4 @@
+int file2()
+{
+  return 1;
+}

+ 1 - 0
Tests/ComplexRelativePaths/Library/file2.h

@@ -0,0 +1 @@
+int file2();

+ 6 - 0
Tests/ComplexRelativePaths/Library/sharedFile.cxx

@@ -0,0 +1,6 @@
+#include "sharedFile.h"
+
+int sharedFunction()
+{
+  return 1;
+}

+ 12 - 0
Tests/ComplexRelativePaths/Library/sharedFile.h

@@ -0,0 +1,12 @@
+#if defined(_WIN32) || defined(WIN32) /* Win32 version */
+#ifdef CMakeTestLibraryShared_EXPORTS
+#  define CMakeTest_EXPORT __declspec(dllexport)
+#else
+#  define CMakeTest_EXPORT __declspec(dllimport)
+#endif
+#else
+// unix needs nothing
+#define CMakeTest_EXPORT
+#endif
+
+CMakeTest_EXPORT int sharedFunction();

+ 11 - 0
Tests/ComplexRelativePaths/VarTests.txt

@@ -0,0 +1,11 @@
+
+SET (ZERO_VAR 0)
+IF(ZERO_VAR)
+ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED)
+ELSE(ZERO_VAR)
+ADD_DEFINITIONS(-DSHOULD_BE_DEFINED)
+ENDIF(ZERO_VAR)
+
+SET(ONE_VAR 1)
+
+SET(STRING_VAR "CMake is great" CACHE STRING "test a cache variable")

+ 5 - 0
Tests/ComplexRelativePaths/cmTestConfigure.h.in

@@ -0,0 +1,5 @@
+#cmakedefine ONE_VAR
+#cmakedefine ZERO_VAR
+#define STRING_VAR "${STRING_VAR}"
+
+

+ 4 - 0
Tests/ComplexRelativePaths/simple.cxx

@@ -0,0 +1,4 @@
+int main ()
+{
+  return 0;
+}