summaryrefslogtreecommitdiff
path: root/Tests/StringFileTest
diff options
context:
space:
mode:
authorAlexander Neundorf <neundorf@kde.org>2007-05-25 15:22:22 -0400
committerAlexander Neundorf <neundorf@kde.org>2007-05-25 15:22:22 -0400
commitf4eb541880bfc89456e26d8b3eb62ec590571da5 (patch)
tree4e549a05db829d9e7fd3324e3f687e0aa2499c65 /Tests/StringFileTest
parent1ed238c7f5f1e2573beb864ea7b2b0c5be4508f2 (diff)
downloadcmake-f4eb541880bfc89456e26d8b3eb62ec590571da5.tar.gz
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')
-rw-r--r--Tests/StringFileTest/CMakeLists.txt22
-rw-r--r--Tests/StringFileTest/main.ihx21
-rw-r--r--Tests/StringFileTest/main.srec21
3 files changed, 64 insertions, 0 deletions
diff --git a/Tests/StringFileTest/CMakeLists.txt b/Tests/StringFileTest/CMakeLists.txt
index c2bb53f830..36d15ce0b9 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")
diff --git a/Tests/StringFileTest/main.ihx b/Tests/StringFileTest/main.ihx
new file mode 100644
index 0000000000..c1d1dd2b3d
--- /dev/null
+++ b/Tests/StringFileTest/main.ihx
@@ -0,0 +1,21 @@
+:03000000020003F8
+:03005C0002005F40
+:05005F0012006480FEA8
+:010064002279
+:0E006900494E464F3A636F6D70696C65725B6D
+:0A007700534443432D4845585D00F3
+:06003200E478FFF6D8FDA2
+:080010007900E94400601B7A4D
+:0500180000900081785A
+:03001D000075A0CB
+:0A00200000E493F2A308B800020503
+:08002A00A0D9F4DAF275A0FF81
+:080038007800E84400600A7939
+:030040000075A0A8
+:0600430000E4F309D8FC03
+:080049007800E84400600C7926
+:0B00510000900000E4F0A3D8FCD9FAF6
+:03000300758107FD
+:0A000600120065E582600302005F4E
+:04006500758200227E
+:00000001FF
diff --git a/Tests/StringFileTest/main.srec b/Tests/StringFileTest/main.srec
new file mode 100644
index 0000000000..bd47c29cc1
--- /dev/null
+++ b/Tests/StringFileTest/main.srec
@@ -0,0 +1,21 @@
+S1060000020003F4
+S106005C02005F3C
+S108005F12006480FEA4
+S10400642275
+S1110069494E464F3A636F6D70696C65725B69
+S10E0077534443432D535245435D00A6
+S1090032E478FFF6D8FD9E
+S10B00107900E94400601B7A49
+S1080018009000827855
+S106001D0075A0C7
+S10D002000E493F2A308B8000205FF
+S10B002AA0D9F4DAF275A0FF7D
+S10B00387800E84400600A7935
+S10600400075A0A4
+S109004300E4F309D8FCFF
+S10B00497800E84400600C7922
+S10E005100900000E4F0A3D8FCD9FAF2
+S1060003758107F9
+S10D0006120065E582600302005F4A
+S1070065758200227A
+S9030000FC