[Cmake-commits] [cmake-commits] alex committed CMakeLists.txt 1.30 1.31 test.bin NONE 1.1

cmake-commits at cmake.org cmake-commits at cmake.org
Sun Sep 6 10:26:27 EDT 2009


Update of /cvsroot/CMake/CMake/Tests/StringFileTest
In directory public:/mounts/ram/cvs-serv29427

Modified Files:
	CMakeLists.txt 
Added Files:
	test.bin 
Log Message:
Add a test for FILE(READ ... HEX) together with a tiny binary file.

Alex


--- NEW FILE: test.bin ---
(This appears to be a binary file; contents omitted.)

Index: CMakeLists.txt
===================================================================
RCS file: /cvsroot/CMake/CMake/Tests/StringFileTest/CMakeLists.txt,v
retrieving revision 1.30
retrieving revision 1.31
diff -C 2 -d -r1.30 -r1.31
*** CMakeLists.txt	13 May 2009 14:30:22 -0000	1.30
--- CMakeLists.txt	6 Sep 2009 14:26:24 -0000	1.31
***************
*** 6,9 ****
--- 6,18 ----
  FILE(READ "${CMAKE_CURRENT_SOURCE_DIR}/InputFile.h.in" infile)
  
+ # Test reading a binary file into hex representation
+ FILE(READ "${CMAKE_CURRENT_SOURCE_DIR}/test.bin" hexContents HEX)
+ 
+ IF("${hexContents}" STREQUAL "0001027700")
+   MESSAGE("FILE(READ HEX) correctly read [${hexContents}]")
+ ELSE("${hexContents}" STREQUAL "0001027700")
+   MESSAGE(SEND_ERROR "FILE(READ HEX) incorrectly read [${hexContents}], but expected was [0001027700]")
+ ENDIF("${hexContents}" STREQUAL "0001027700")
+ 
  # FILE(STRINGS) test
  FILE(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/InputFile.h.in" infile_strings



More information about the Cmake-commits mailing list