summaryrefslogtreecommitdiffstats
path: root/Tests/StringFileTest
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2008-01-02 23:00:19 (GMT)
committerBrad King <brad.king@kitware.com>2008-01-02 23:00:19 (GMT)
commit3fbd0ad869d51b15fe8c8f052a2c67761669e068 (patch)
tree4dcf1caa1153fefd04a621bbbdff49f0ec72ea92 /Tests/StringFileTest
parentdcd9a1b59f58031a1eb94841a9c1cb58d5f9eff1 (diff)
downloadCMake-3fbd0ad869d51b15fe8c8f052a2c67761669e068.zip
CMake-3fbd0ad869d51b15fe8c8f052a2c67761669e068.tar.gz
CMake-3fbd0ad869d51b15fe8c8f052a2c67761669e068.tar.bz2
ENH: Add test for FILE(READ ...HEX).
Diffstat (limited to 'Tests/StringFileTest')
-rw-r--r--Tests/StringFileTest/CMakeLists.txt7
1 files changed, 7 insertions, 0 deletions
diff --git a/Tests/StringFileTest/CMakeLists.txt b/Tests/StringFileTest/CMakeLists.txt
index 9768947..f3041c3 100644
--- a/Tests/StringFileTest/CMakeLists.txt
+++ b/Tests/StringFileTest/CMakeLists.txt
@@ -16,6 +16,13 @@ ELSE("${infile_strings}" STREQUAL "${infile_strings_goal}")
"FILE(STRINGS) incorrectly read [${infile_strings}]")
ENDIF("${infile_strings}" STREQUAL "${infile_strings_goal}")
+# test reading a file and getting its binary data as hex string
+FILE(READ "${CMAKE_CURRENT_SOURCE_DIR}/main.srec" infilehex LIMIT 4 HEX)
+IF(NOT "${infilehex}" STREQUAL "53313036")
+ MESSAGE(SEND_ERROR
+ "FILE(READ ... HEX) error, read: \"${infilehex}\", expected \"53313036\"")
+ENDIF(NOT "${infilehex}" STREQUAL "53313036")
+
# test that FILE(STRINGS) also work with Intel hex and Motorola S-record files
# this file has been created with "sdcc main.c"