From 14b07c0973f367352a75550af864b56dc99c3848 Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Thu, 23 May 2002 13:04:00 -0400 Subject: add a test for escape quotes and configure file --- Tests/Complex/CMakeLists.txt | 6 ++++++ Tests/Complex/Executable/complex.cxx | 13 +++++++++++++ Tests/Complex/cmTestConfigureEscape.h.in | 1 + Tests/ComplexOneConfig/CMakeLists.txt | 6 ++++++ Tests/ComplexOneConfig/Executable/complex.cxx | 13 +++++++++++++ Tests/ComplexOneConfig/cmTestConfigureEscape.h.in | 1 + Tests/ComplexRelativePaths/CMakeLists.txt | 6 ++++++ Tests/ComplexRelativePaths/Executable/complex.cxx | 13 +++++++++++++ Tests/ComplexRelativePaths/cmTestConfigureEscape.h.in | 1 + 9 files changed, 60 insertions(+) create mode 100644 Tests/Complex/cmTestConfigureEscape.h.in create mode 100644 Tests/ComplexOneConfig/cmTestConfigureEscape.h.in create mode 100644 Tests/ComplexRelativePaths/cmTestConfigureEscape.h.in diff --git a/Tests/Complex/CMakeLists.txt b/Tests/Complex/CMakeLists.txt index 5cead76..bbf72a0 100644 --- a/Tests/Complex/CMakeLists.txt +++ b/Tests/Complex/CMakeLists.txt @@ -156,6 +156,12 @@ CONFIGURE_FILE( ${Complex_SOURCE_DIR}/cmTestConfigure.h.in ${Complex_BINARY_DIR}/cmTestConfigure.h) +SET(STRING_WITH_QUOTES "\"hello world\"") +# test CONFIGURE_FILE with ESCAPE_QUOTES on +CONFIGURE_FILE( + ${Complex_SOURCE_DIR}/cmTestConfigureEscape.h.in + ${Complex_BINARY_DIR}/cmTestConfigureEscape.h ESCAPE_QUOTES) + # # Create the libs and the main exe # diff --git a/Tests/Complex/Executable/complex.cxx b/Tests/Complex/Executable/complex.cxx index fb268c4..0b20bfd 100644 --- a/Tests/Complex/Executable/complex.cxx +++ b/Tests/Complex/Executable/complex.cxx @@ -1,4 +1,5 @@ #include "cmTestConfigure.h" +#include "cmTestConfigureEscape.h" #include "cmVersion.h" #include "ExtraSources/file1.h" #include "file2.h" @@ -678,6 +679,18 @@ int main() { cmFailed("SEPARATE_ARGUMENTS is not working"); } + + // ---------------------------------------------------------------------- + // Test Escape Quotes + if(strcmp("\"hello world\"", STRING_WITH_QUOTES) == 0) + { + cmPassed("ESCAPE_QUOTES is working"); + } + else + { + cmFailed("ESCAPE_QUOTES is not working"); + } + // ---------------------------------------------------------------------- // Summary diff --git a/Tests/Complex/cmTestConfigureEscape.h.in b/Tests/Complex/cmTestConfigureEscape.h.in new file mode 100644 index 0000000..39a8bd6 --- /dev/null +++ b/Tests/Complex/cmTestConfigureEscape.h.in @@ -0,0 +1 @@ +#define STRING_WITH_QUOTES "${STRING_WITH_QUOTES}" diff --git a/Tests/ComplexOneConfig/CMakeLists.txt b/Tests/ComplexOneConfig/CMakeLists.txt index 5cead76..bbf72a0 100644 --- a/Tests/ComplexOneConfig/CMakeLists.txt +++ b/Tests/ComplexOneConfig/CMakeLists.txt @@ -156,6 +156,12 @@ CONFIGURE_FILE( ${Complex_SOURCE_DIR}/cmTestConfigure.h.in ${Complex_BINARY_DIR}/cmTestConfigure.h) +SET(STRING_WITH_QUOTES "\"hello world\"") +# test CONFIGURE_FILE with ESCAPE_QUOTES on +CONFIGURE_FILE( + ${Complex_SOURCE_DIR}/cmTestConfigureEscape.h.in + ${Complex_BINARY_DIR}/cmTestConfigureEscape.h ESCAPE_QUOTES) + # # Create the libs and the main exe # diff --git a/Tests/ComplexOneConfig/Executable/complex.cxx b/Tests/ComplexOneConfig/Executable/complex.cxx index fb268c4..0b20bfd 100644 --- a/Tests/ComplexOneConfig/Executable/complex.cxx +++ b/Tests/ComplexOneConfig/Executable/complex.cxx @@ -1,4 +1,5 @@ #include "cmTestConfigure.h" +#include "cmTestConfigureEscape.h" #include "cmVersion.h" #include "ExtraSources/file1.h" #include "file2.h" @@ -678,6 +679,18 @@ int main() { cmFailed("SEPARATE_ARGUMENTS is not working"); } + + // ---------------------------------------------------------------------- + // Test Escape Quotes + if(strcmp("\"hello world\"", STRING_WITH_QUOTES) == 0) + { + cmPassed("ESCAPE_QUOTES is working"); + } + else + { + cmFailed("ESCAPE_QUOTES is not working"); + } + // ---------------------------------------------------------------------- // Summary diff --git a/Tests/ComplexOneConfig/cmTestConfigureEscape.h.in b/Tests/ComplexOneConfig/cmTestConfigureEscape.h.in new file mode 100644 index 0000000..39a8bd6 --- /dev/null +++ b/Tests/ComplexOneConfig/cmTestConfigureEscape.h.in @@ -0,0 +1 @@ +#define STRING_WITH_QUOTES "${STRING_WITH_QUOTES}" diff --git a/Tests/ComplexRelativePaths/CMakeLists.txt b/Tests/ComplexRelativePaths/CMakeLists.txt index 5cead76..bbf72a0 100644 --- a/Tests/ComplexRelativePaths/CMakeLists.txt +++ b/Tests/ComplexRelativePaths/CMakeLists.txt @@ -156,6 +156,12 @@ CONFIGURE_FILE( ${Complex_SOURCE_DIR}/cmTestConfigure.h.in ${Complex_BINARY_DIR}/cmTestConfigure.h) +SET(STRING_WITH_QUOTES "\"hello world\"") +# test CONFIGURE_FILE with ESCAPE_QUOTES on +CONFIGURE_FILE( + ${Complex_SOURCE_DIR}/cmTestConfigureEscape.h.in + ${Complex_BINARY_DIR}/cmTestConfigureEscape.h ESCAPE_QUOTES) + # # Create the libs and the main exe # diff --git a/Tests/ComplexRelativePaths/Executable/complex.cxx b/Tests/ComplexRelativePaths/Executable/complex.cxx index fb268c4..0b20bfd 100644 --- a/Tests/ComplexRelativePaths/Executable/complex.cxx +++ b/Tests/ComplexRelativePaths/Executable/complex.cxx @@ -1,4 +1,5 @@ #include "cmTestConfigure.h" +#include "cmTestConfigureEscape.h" #include "cmVersion.h" #include "ExtraSources/file1.h" #include "file2.h" @@ -678,6 +679,18 @@ int main() { cmFailed("SEPARATE_ARGUMENTS is not working"); } + + // ---------------------------------------------------------------------- + // Test Escape Quotes + if(strcmp("\"hello world\"", STRING_WITH_QUOTES) == 0) + { + cmPassed("ESCAPE_QUOTES is working"); + } + else + { + cmFailed("ESCAPE_QUOTES is not working"); + } + // ---------------------------------------------------------------------- // Summary diff --git a/Tests/ComplexRelativePaths/cmTestConfigureEscape.h.in b/Tests/ComplexRelativePaths/cmTestConfigureEscape.h.in new file mode 100644 index 0000000..39a8bd6 --- /dev/null +++ b/Tests/ComplexRelativePaths/cmTestConfigureEscape.h.in @@ -0,0 +1 @@ +#define STRING_WITH_QUOTES "${STRING_WITH_QUOTES}" -- cgit v0.12