summaryrefslogtreecommitdiffstats
path: root/Tests/StringFileTest/CMakeLists.txt
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2007-04-25 21:22:07 (GMT)
committerBrad King <brad.king@kitware.com>2007-04-25 21:22:07 (GMT)
commit0fb689973eb34ba6172b3805569091984e37e911 (patch)
treee6a21f01e9d29ebaf7ce6894c277c042d4f9a7dd /Tests/StringFileTest/CMakeLists.txt
parentf693951480766d026e0627447c897af1e8b87759 (diff)
downloadCMake-0fb689973eb34ba6172b3805569091984e37e911.zip
CMake-0fb689973eb34ba6172b3805569091984e37e911.tar.gz
CMake-0fb689973eb34ba6172b3805569091984e37e911.tar.bz2
ENH: Added FILE(STRINGS) command.
Diffstat (limited to 'Tests/StringFileTest/CMakeLists.txt')
-rw-r--r--Tests/StringFileTest/CMakeLists.txt12
1 files changed, 12 insertions, 0 deletions
diff --git a/Tests/StringFileTest/CMakeLists.txt b/Tests/StringFileTest/CMakeLists.txt
index a682076..618f92a 100644
--- a/Tests/StringFileTest/CMakeLists.txt
+++ b/Tests/StringFileTest/CMakeLists.txt
@@ -4,6 +4,18 @@ INCLUDE_DIRECTORIES(${StringFileTest_BINARY_DIR})
# Read file test
FILE(READ "${CMAKE_CURRENT_SOURCE_DIR}/InputFile.h.in" infile)
+# FILE(STRINGS) test
+FILE(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/InputFile.h.in" infile_strings
+ LIMIT_COUNT 1 LIMIT_INPUT 1024 LIMIT_OUTPUT 1024
+ LENGTH_MINIMUM 10 LENGTH_MAXIMUM 23 REGEX include NEWLINE_CONSUME)
+SET(infile_strings_goal "#include \"includefile\"\n")
+IF("${infile_strings}" STREQUAL "${infile_strings_goal}")
+ MESSAGE("FILE(STRINGS) correctly read [${infile_strings}]")
+ELSE("${infile_strings}" STREQUAL "${infile_strings_goal}")
+ MESSAGE(SEND_ERROR
+ "FILE(STRINGS) incorrectly read [${infile_strings}]")
+ENDIF("${infile_strings}" STREQUAL "${infile_strings_goal}")
+
# String test
STRING(REGEX MATCH "[cC][mM][aA][kK][eE]" rmvar "CMake is great")
STRING(REGEX MATCHALL "[cC][mM][aA][kK][eE]" rmallvar "CMake is better than cmake or CMake")