summaryrefslogtreecommitdiffstats
path: root/Tests/StringFileTest/CMakeLists.txt
diff options
context:
space:
mode:
authorAlexander Neundorf <neundorf@kde.org>2007-05-25 19:22:22 (GMT)
committerAlexander Neundorf <neundorf@kde.org>2007-05-25 19:22:22 (GMT)
commitf4eb541880bfc89456e26d8b3eb62ec590571da5 (patch)
tree4e549a05db829d9e7fd3324e3f687e0aa2499c65 /Tests/StringFileTest/CMakeLists.txt
parent1ed238c7f5f1e2573beb864ea7b2b0c5be4508f2 (diff)
downloadCMake-f4eb541880bfc89456e26d8b3eb62ec590571da5.zip
CMake-f4eb541880bfc89456e26d8b3eb62ec590571da5.tar.gz
CMake-f4eb541880bfc89456e26d8b3eb62ec590571da5.tar.bz2
ENH: make the compiler id detection work, even if the output file name of
the compiler is completely unknown and even if it produces intel hex or motorola s-record files, with test Alex
Diffstat (limited to 'Tests/StringFileTest/CMakeLists.txt')
-rw-r--r--Tests/StringFileTest/CMakeLists.txt22
1 files changed, 22 insertions, 0 deletions
diff --git a/Tests/StringFileTest/CMakeLists.txt b/Tests/StringFileTest/CMakeLists.txt
index c2bb53f..36d15ce 100644
--- a/Tests/StringFileTest/CMakeLists.txt
+++ b/Tests/StringFileTest/CMakeLists.txt
@@ -16,6 +16,28 @@ ELSE("${infile_strings}" STREQUAL "${infile_strings_goal}")
"FILE(STRINGS) incorrectly read [${infile_strings}]")
ENDIF("${infile_strings}" STREQUAL "${infile_strings_goal}")
+
+# test that FILE(STRINGS) also work with Intel hex and Motorola S-record files
+# this file has been created with "sdcc main.c"
+FILE(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/main.ihx" infile_strings REGEX INFO)
+SET(infile_strings_goal "INFO:compiler\\[SDCC-HEX\\]")
+IF("${infile_strings}" MATCHES "${infile_strings_goal}")
+ MESSAGE("FILE(STRINGS) correctly read from hex file [${infile_strings}]")
+ELSE("${infile_strings}" MATCHES "${infile_strings_goal}")
+ MESSAGE(SEND_ERROR
+ "FILE(STRINGS) incorrectly read from hex file [${infile_strings}]")
+ENDIF("${infile_strings}" MATCHES "${infile_strings_goal}")
+
+# this file has been created with "sdcc main.c --out-fmt-s19"
+FILE(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/main.srec" infile_strings REGEX INFO)
+SET(infile_strings_goal "INFO:compiler\\[SDCC-SREC\\]")
+IF("${infile_strings}" MATCHES "${infile_strings_goal}")
+ MESSAGE("FILE(STRINGS) correctly read from srec file [${infile_strings}]")
+ELSE("${infile_strings}" MATCHES "${infile_strings_goal}")
+ MESSAGE(SEND_ERROR
+ "FILE(STRINGS) incorrectly read from srec file [${infile_strings}]")
+ENDIF("${infile_strings}" MATCHES "${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")