ENH: Add cmake code to do testing if user has properly setup a testimages directory

This commit is contained in:
Mathieu Malaterre 2007-09-07 13:21:17 +00:00
parent 2479921c71
commit b29cff9b9c
3 changed files with 18 additions and 1 deletions

View File

@ -91,6 +91,20 @@ IF(OPENJPEG_STANDALONE)
ENDIF(BUILD_TESTING)
ENDIF(OPENJPEG_STANDALONE)
# TODO, technically we should add tests, e.g:
# Adding test with dataset from:
# http://www.crc.ricoh.com/~gormish/jpeg2000conformance/
# http://www.jpeg.org/jpeg2000guide/testimages/testimages.html
FILE(GLOB_RECURSE OPENJPEG_DATA_IMAGES_GLOB
# "${OPENJPEG_SOURCE_DIR}/testing1/*.j2k"
# "${OPENJPEG_SOURCE_DIR}/testing1/*.jp2"
"${OPENJPEG_SOURCE_DIR}/testimages/*.j2k"
"${OPENJPEG_SOURCE_DIR}/testimages/*.j2c"
"${OPENJPEG_SOURCE_DIR}/testimages/*.jp2"
)
FOREACH(filename ${OPENJPEG_DATA_IMAGES_GLOB})
GET_FILENAME_COMPONENT(filename_temp ${filename} NAME)
ADD_TEST(j2i-${filename_temp} ${EXECUTABLE_OUTPUT_PATH}/j2k_to_image -i ${filename} -o ${filename_temp}.tif)
ENDFOREACH(filename)

View File

@ -7,6 +7,7 @@ What's New for OpenJPEG
September 7, 2007
* [Mathieu Malaterre] Upon failure, properly return error code (!=0).
* [Mathieu Malaterre] CMake: Add cmake code to do testing if user has properly setup a testimages directory
September 6, 2007
+ [Mathieu Malaterre] CMake: start compiling mj2, jpwl and jp3d

View File

@ -43,6 +43,8 @@ FOREACH(exe j2k_to_image image_to_j2k)
ADD_EXECUTABLE(${exe} ${exe}.c ${common_SRCS})
TARGET_LINK_LIBRARIES(${exe} ${OPJ_PREFIX}openjpeg ${TIFF_LIBRARIES})
ADD_TEST(${exe} ${EXECUTABLE_OUTPUT_PATH}/${exe})
# calling those exe without option will make them fail always:
SET_TESTS_PROPERTIES(${exe} PROPERTIES WILL_FAIL TRUE)
# On unix you need to link to the math library:
IF(UNIX)
TARGET_LINK_LIBRARIES(${exe} m)