added new decoding/dump tests based on data found in input/nonregresion repository (remove JPEG2000_CONFORMANCE_DATA_ROOT variable, add REF_DECODER_BIN_PATH variable for the encoder test suite). Remove definitively old tests

This commit is contained in:
Mickael Savinaud 2011-07-27 12:45:04 +00:00
parent 1776120dba
commit f88a57e5d7
5 changed files with 64 additions and 54 deletions

View File

@ -5,6 +5,9 @@ What's New for OpenJPEG
! : changed
+ : added
July 27, 2011
! [mickael] added new decoding/dump tests based on data found in input/nonregresion repository (remove JPEG2000_CONFORMANCE_DATA_ROOT variable, add REF_DECODER_BIN_PATH variable for the encoder test suite). Remove definitively old tests.
July 26, 2011
! [mickael] delete double semi-colon at end of line which generate crash on win platform
! [mickael] use ansi c function fgets instead of GNU function getline to avoid build error with win platform

View File

@ -250,25 +250,15 @@ IF(BUILD_TESTING)
# svn checkout http://openjpeg.googlecode.com/svn/data (about 70 Mo)
FIND_PATH(OPJ_DATA_ROOT README-OPJ-Data
PATHS $ENV{OPJ_DATA_ROOT} ${CMAKE_SOURCE_DIR}/../opj-data)
SET (REF_DECODER_BIN_PATH "NOT-FOUND" CACHE PATH "Single directory where find the reference encoder binaries to enable encoding test suite.")
MARK_AS_ADVANCED(REF_DECODER_BIN_PATH)
ELSE(BUILD_CODEC)
message(FATAL_ERROR "You need build codec to run the tests")
ENDIF(BUILD_CODEC)
ENDIF(BUILD_TESTING)
#-----------------------------------------------------------------------------
# Tests data
IF(BUILD_TESTING)
# Adding test with dataset from:
# http://www.openjpeg.org/conformance/j2kp4files_v1_5.zip
# -> wget http://www.openjpeg.org/conformance/j2kp4files_v1_5.zip
# http://www.jpeg.org/jpeg2000guide/testimages/testimages.html
# Adding JPEG2000_CONFORMANCE_DATA_ROOT
FIND_PATH(JPEG2000_CONFORMANCE_DATA_ROOT testimages.html
${OPENJPEG_SOURCE_DIR}/../jpeg2000testimages
$ENV{JPEG2000_CONFORMANCE_DATA_ROOT}
)
ENDIF(BUILD_TESTING)
#-----------------------------------------------------------------------------
# install all targets referenced as OPENJPEGTargets
INSTALL(EXPORT OpenJPEGTargets DESTINATION ${OPENJPEG_INSTALL_PACKAGE_DIR})

View File

@ -39,9 +39,6 @@ FOREACH(exe j2k_to_image image_to_j2k j2k_dump)
TARGET_LINK_LIBRARIES(${exe} ${OPENJPEG_LIBRARY_NAME}
${Z_LIBNAME} ${PNG_LIBNAME} ${TIFF_LIBNAME} ${LCMS_LIBNAME} )
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)
@ -99,40 +96,4 @@ IF(BUILD_JPWL)
INSTALL(TARGETS JPWL_image_to_j2k JPWL_j2k_to_image
DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications
)
ENDIF(BUILD_JPWL)
#if(BUILD_TESTING)
## Do testing here, once we know the examples are being built:
#FILE(GLOB_RECURSE OPENJPEG_DATA_IMAGES_GLOB
# "${JPEG2000_CONFORMANCE_DATA_ROOT}/*.j2k"
# "${JPEG2000_CONFORMANCE_DATA_ROOT}/*.j2c"
# "${JPEG2000_CONFORMANCE_DATA_ROOT}/*.jp2"
# )
#foreach(filename ${OPENJPEG_DATA_IMAGES_GLOB})
# get_filename_component(filename_temp ${filename} NAME)
# get_filename_component(filename_ext ${filename} EXT)
# execute_process(COMMAND ${EXECUTABLE_OUTPUT_PATH}/j2k_dump -i ${filename}
# OUTPUT_VARIABLE dump_success
# OUTPUT_FILE ${CMAKE_CURRENT_BINARY_DIR}/${filename_temp}.dump
# ERROR_QUIET
# )
# if(dump_success)
# file(READ ${CMAKE_CURRENT_BINARY_DIR}/${filename_temp}.dump numcomp_file)
# string(REGEX REPLACE ".*numcomps=([0-9]+).*" "\\1"
# numcomps "${numcomp_file}")
# #message( "found:${output_variable} for ${filename_temp}" )
# endif()
# ADD_TEST(dump-${filename_temp} ${EXECUTABLE_OUTPUT_PATH}/j2k_dump -i ${filename})
# foreach(codec_type ppm pgx bmp tif raw tga png)
# ADD_TEST(j2i-${filename_temp}-${codec_type} ${EXECUTABLE_OUTPUT_PATH}/j2k_to_image -i ${filename} -o ${filename_temp}.${codec_type})
# endforeach(codec_type)
# foreach(codec_type ppm bmp tif tga png)
# ADD_TEST(i2j-${filename_temp}-${codec_type} ${EXECUTABLE_OUTPUT_PATH}/image_to_j2k -i ${filename_temp}.${codec_type} -o ${filename_temp}.${codec_type}${filename_ext})
# SET_TESTS_PROPERTIES(i2j-${filename_temp}-${codec_type} PROPERTIES DEPENDS j2i-${filename_temp}-${codec_type})
# #if(UNIX)
# # ADD_TEST(cmp-${filename_temp}-${codec_type} cmp ${filename} ${filename_temp}.${codec_type}${filename_ext})
# #endif(UNIX)
# endforeach(codec_type)
#endforeach(filename)
#endif(BUILD_TESTING)
ENDIF(BUILD_JPWL)

View File

@ -42,3 +42,4 @@ IF(NOT HAVE_LIBPNG)
ENDIF(NOT HAVE_LIBPNG)
ADD_SUBDIRECTORY(conformance)
ADD_SUBDIRECTORY(nonregression)

View File

@ -0,0 +1,55 @@
# NON-REGRESSION TESTS ON THIS DATASET LOCATED ${OPJ_DATA_ROOT}/input/nonregression
FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/Temporary)
SET(TEMP ${CMAKE_CURRENT_BINARY_DIR}/Temporary)
SET(BASELINE_NR ${OPJ_DATA_ROOT}/baseline/nonregression)
SET(INPUT_NR ${OPJ_DATA_ROOT}/input/nonregression)
FILE(GLOB_RECURSE OPJ_DATA_NR_LIST
"${INPUT_NR}/*.j2k"
"${INPUT_NR}/*.j2c"
"${INPUT_NR}/*.jp2"
)
FOREACH(filepath ${OPJ_DATA_NR_LIST})
GET_FILENAME_COMPONENT(filename ${filepath} NAME)
GET_FILENAME_COMPONENT(filenameSub ${filename} NAME_WE)
message("${filenameSub}")
ADD_TEST(NR-${filename}-dump
${EXECUTABLE_OUTPUT_PATH}/j2k_dump
-i ${filepath}
-o ${TEMP}/${filename}.txt
)
ADD_TEST(NR-${filename}-compare_dump2base
${EXECUTABLE_OUTPUT_PATH}/compare_dump_files
-b ${BASELINE_NR}/opj_${filenameSub}.txt
-t ${TEMP}/${filename}.txt
)
SET_TESTS_PROPERTIES(NR-${filename}-compare_dump2base
PROPERTIES DEPENDS
NR-${filename}-dump)
ADD_TEST(NR-${filename}-decode
${EXECUTABLE_OUTPUT_PATH}/j2k_to_image
-i ${filepath}
-o ${TEMP}/${filename}.pgx
)
# ADD_TEST(NR-${filename}-compare2base
# ${EXECUTABLE_OUTPUT_PATH}/comparePGXimages
# -b ${BASELINE_NR}/opj_${filenameRef}
# -t ${TEMP}/${filename}.pgx
# -n ${nbComponents}
# -d
# -s b_t_
# )
#
# SET_TESTS_PROPERTIES(NR-${filename}-compare2base
# PROPERTIES DEPENDS
# NR-${filename}-decode)
ENDFOREACH(filepath)