[CMake] ctest question

Kedzierski, Artur CIV NAVSURFWARCENDIV CORONA artur.kedzierski at navy.mil
Thu Sep 27 14:28:34 EDT 2007


	I've ran into similar problem.
	Instead of keeping the original files as golden results, I 
wanted to keep MD5 checksums of these files. There are two reasons 
for it: disk space constraints and different file format
support. The generated files can take up a lot of disk space. If
a MD5 checksum difference is detected, I can roll back a revision
and generate the original file.  Also, I wanted to perform similar
test on software that generates images (jpeg, etc.).
	Because these scheme has to work on Linux and Windows, I've
wrote python script that computes file's MD5 checksum and compares
it to given golden result. This is something that I've done (CheckMD5.py
is the script mentioned before):

FIND_PACKAGE(PytonInterp)
IF(PYTHONINTERP_FOUND)
	ADD_TEST(test1 my_program "${CMAKE_BINARY_DIR}/test.txt")
	ADD_TEST(test2 "${PYTHON_EXECUTABLE}"
"${PROJECT_SOURCE_DIR}/CheckMD5.py" "${CMAKE_BINARY_DIR}/test.txt"
1a3fdcea)
	....
ENDIF(PYTHONINTERP_FOUND)

	That did the trick. However, now Dart2 shows reports about
possible memory leaks inside of python interpreter. Has anybody 
else did something similar? It would be if CMake contained
macro like this:
ADD_MD5_TEST(testname generatedfile md5checksum)


--
Artur Kedzierski 

> -----Original Message-----
> From: cmake-bounces+artur.kedzierski=navy.mil at cmake.org 
> [mailto:cmake-bounces+artur.kedzierski=navy.mil at cmake.org] On 
> Behalf Of Juan Sanchez
> Sent: Sunday, September 23, 2007 12:49
> To: CMake ML
> Subject: [CMake] ctest question
> 
> I want run a test program and pipe its results to a file.  I 
> then want to compare this file to the golden results using diff.
> 
> Does anyone have a macro or cookbook example for doing this?
> 
> Thank you,
> 
> Juan
> 
> 
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake
> 


More information about the CMake mailing list