summaryrefslogtreecommitdiffstats
path: root/Tests/CMakeTests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-03-09 12:42:02 (GMT)
committerBrad King <brad.king@kitware.com>2015-03-09 13:17:59 (GMT)
commit024e25e485f8d1dbca40521fbc0bcd61e383f413 (patch)
treecefc356363aac67d1aa5c2643f7b12392b1dc8d7 /Tests/CMakeTests
parent3ef776fc38fecff332e568f307dcf4e6f82fbe14 (diff)
downloadCMake-024e25e485f8d1dbca40521fbc0bcd61e383f413.zip
CMake-024e25e485f8d1dbca40521fbc0bcd61e383f413.tar.gz
CMake-024e25e485f8d1dbca40521fbc0bcd61e383f413.tar.bz2
Tests: Add more signature tests to RunCMake.configure_file test
Move the test cases from Tests/CMakeTests/ConfigureFileTest.cmake.in over to use the RunCMake.configure_file infrastructure. This does much more robust verification of CMake output for each test case, and would have caught the regression fixed in our parent commit.
Diffstat (limited to 'Tests/CMakeTests')
-rw-r--r--Tests/CMakeTests/CMakeLists.txt1
-rw-r--r--Tests/CMakeTests/ConfigureFile-BadArg.cmake1
-rw-r--r--Tests/CMakeTests/ConfigureFile-DirInput.cmake1
-rw-r--r--Tests/CMakeTests/ConfigureFile-DirOutput.cmake5
-rw-r--r--Tests/CMakeTests/ConfigureFile-NewLineStyle-COPYONLY.cmake3
-rw-r--r--Tests/CMakeTests/ConfigureFile-NewLineStyle-NoArg.cmake3
-rw-r--r--Tests/CMakeTests/ConfigureFile-NewLineStyle-ValidArg.cmake17
-rw-r--r--Tests/CMakeTests/ConfigureFile-NewLineStyle-WrongArg.cmake3
-rw-r--r--Tests/CMakeTests/ConfigureFile-Relative.cmake4
-rw-r--r--Tests/CMakeTests/ConfigureFileTest.cmake.in28
10 files changed, 0 insertions, 66 deletions
diff --git a/Tests/CMakeTests/CMakeLists.txt b/Tests/CMakeTests/CMakeLists.txt
index ce36830..d5524c3 100644
--- a/Tests/CMakeTests/CMakeLists.txt
+++ b/Tests/CMakeTests/CMakeLists.txt
@@ -19,7 +19,6 @@ AddCMakeTest(GetFilenameComponentRealpath "")
AddCMakeTest(Version "")
AddCMakeTest(Message "")
AddCMakeTest(File "")
-AddCMakeTest(ConfigureFile "")
AddCMakeTest(SeparateArguments "")
AddCMakeTest(ImplicitLinkInfo "")
AddCMakeTest(ModuleNotices "")
diff --git a/Tests/CMakeTests/ConfigureFile-BadArg.cmake b/Tests/CMakeTests/ConfigureFile-BadArg.cmake
deleted file mode 100644
index 769fae1..0000000
--- a/Tests/CMakeTests/ConfigureFile-BadArg.cmake
+++ /dev/null
@@ -1 +0,0 @@
-configure_file(.)
diff --git a/Tests/CMakeTests/ConfigureFile-DirInput.cmake b/Tests/CMakeTests/ConfigureFile-DirInput.cmake
deleted file mode 100644
index 920ea28..0000000
--- a/Tests/CMakeTests/ConfigureFile-DirInput.cmake
+++ /dev/null
@@ -1 +0,0 @@
-configure_file(. .)
diff --git a/Tests/CMakeTests/ConfigureFile-DirOutput.cmake b/Tests/CMakeTests/ConfigureFile-DirOutput.cmake
deleted file mode 100644
index d682a2d..0000000
--- a/Tests/CMakeTests/ConfigureFile-DirOutput.cmake
+++ /dev/null
@@ -1,5 +0,0 @@
-file(WRITE ${CMAKE_CURRENT_SOURCE_DIR}/ConfigureFile-DirOutput.txt "DirOutput test file\n")
-file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/ConfigureFile-DirOutput)
-configure_file(ConfigureFile-DirOutput.txt ConfigureFile-DirOutput)
-file(READ ${CMAKE_CURRENT_BINARY_DIR}/ConfigureFile-DirOutput/ConfigureFile-DirOutput.txt out)
-message("${out}")
diff --git a/Tests/CMakeTests/ConfigureFile-NewLineStyle-COPYONLY.cmake b/Tests/CMakeTests/ConfigureFile-NewLineStyle-COPYONLY.cmake
deleted file mode 100644
index 3b09eb0..0000000
--- a/Tests/CMakeTests/ConfigureFile-NewLineStyle-COPYONLY.cmake
+++ /dev/null
@@ -1,3 +0,0 @@
-set(file_name ${CMAKE_CURRENT_SOURCE_DIR}/ConfigureFile-NewLineStyle.txt)
-file(WRITE ${file_name} "Data\n")
-configure_file(${file_name} ${file_name}.out COPYONLY NEWLINE_STYLE DOS)
diff --git a/Tests/CMakeTests/ConfigureFile-NewLineStyle-NoArg.cmake b/Tests/CMakeTests/ConfigureFile-NewLineStyle-NoArg.cmake
deleted file mode 100644
index 133a67a..0000000
--- a/Tests/CMakeTests/ConfigureFile-NewLineStyle-NoArg.cmake
+++ /dev/null
@@ -1,3 +0,0 @@
-set(file_name ${CMAKE_CURRENT_SOURCE_DIR}/ConfigureFile-NewLineStyle.txt)
-file(WRITE ${file_name} "Data\n")
-configure_file(${file_name} ${file_name}.out NEWLINE_STYLE)
diff --git a/Tests/CMakeTests/ConfigureFile-NewLineStyle-ValidArg.cmake b/Tests/CMakeTests/ConfigureFile-NewLineStyle-ValidArg.cmake
deleted file mode 100644
index b7e619c..0000000
--- a/Tests/CMakeTests/ConfigureFile-NewLineStyle-ValidArg.cmake
+++ /dev/null
@@ -1,17 +0,0 @@
-set(file_name ${CMAKE_CURRENT_SOURCE_DIR}/ConfigureFile-NewLineStyle.txt)
-
-function(test_eol style in out)
- file(WRITE ${file_name} "${in}")
- configure_file(${file_name} ${file_name}.out NEWLINE_STYLE ${style})
- file(READ ${file_name}.out new HEX)
- if(NOT "${new}" STREQUAL "${out}")
- message(FATAL_ERROR "No ${style} line endings")
- endif()
-endfunction()
-
-test_eol(DOS "a\n" "610d0a")
-test_eol(WIN32 "b\n" "620d0a")
-test_eol(CRLF "c\n" "630d0a")
-
-test_eol(UNIX "d\n" "640a")
-test_eol(LF "e\n" "650a")
diff --git a/Tests/CMakeTests/ConfigureFile-NewLineStyle-WrongArg.cmake b/Tests/CMakeTests/ConfigureFile-NewLineStyle-WrongArg.cmake
deleted file mode 100644
index e8887c1..0000000
--- a/Tests/CMakeTests/ConfigureFile-NewLineStyle-WrongArg.cmake
+++ /dev/null
@@ -1,3 +0,0 @@
-set(file_name ${CMAKE_CURRENT_SOURCE_DIR}/ConfigureFile-NewLineStyle.txt)
-file(WRITE ${file_name} "Data\n")
-configure_file(${file_name} ${file_name}.out NEWLINE_STYLE FOO)
diff --git a/Tests/CMakeTests/ConfigureFile-Relative.cmake b/Tests/CMakeTests/ConfigureFile-Relative.cmake
deleted file mode 100644
index 532580a..0000000
--- a/Tests/CMakeTests/ConfigureFile-Relative.cmake
+++ /dev/null
@@ -1,4 +0,0 @@
-file(WRITE ${CMAKE_CURRENT_SOURCE_DIR}/ConfigureFile-Relative-In.txt "Relative test file\n")
-configure_file(ConfigureFile-Relative-In.txt ConfigureFile-Relative-Out.txt)
-file(READ ${CMAKE_CURRENT_BINARY_DIR}/ConfigureFile-Relative-Out.txt out)
-message("${out}")
diff --git a/Tests/CMakeTests/ConfigureFileTest.cmake.in b/Tests/CMakeTests/ConfigureFileTest.cmake.in
deleted file mode 100644
index 6cc61d9..0000000
--- a/Tests/CMakeTests/ConfigureFileTest.cmake.in
+++ /dev/null
@@ -1,28 +0,0 @@
-set(DirInput-RESULT 1)
-set(DirInput-STDERR "is a directory")
-set(DirOutput-RESULT 0)
-set(DirOutput-STDERR "DirOutput test file")
-set(Relative-RESULT 0)
-set(Relative-STDERR "Relative test file")
-set(BadArg-RESULT 1)
-set(BadArg-STDERR "called with incorrect number of arguments")
-set(NewLineStyle-NoArg-RESULT 1)
-set(NewLineStyle-NoArg-STDERR "NEWLINE_STYLE must set a style:")
-set(NewLineStyle-WrongArg-RESULT 1)
-set(NewLineStyle-WrongArg-STDERR "NEWLINE_STYLE sets an unknown style")
-set(NewLineStyle-ValidArg-RESULT 0)
-set(NewLineStyle-ValidArg-STDERR )
-set(NewLineStyle-COPYONLY-RESULT 1)
-set(NewLineStyle-COPYONLY-STDERR "COPYONLY could not be used in combination")
-
-include("@CMAKE_CURRENT_SOURCE_DIR@/CheckCMakeTest.cmake")
-check_cmake_test(ConfigureFile
- DirInput
- DirOutput
- Relative
- BadArg
- NewLineStyle-NoArg
- NewLineStyle-WrongArg
- NewLineStyle-ValidArg
- NewLineStyle-COPYONLY
- )