diff --git a/CHANGES b/CHANGES index 98ba1377..68491650 100644 --- a/CHANGES +++ b/CHANGES @@ -6,6 +6,7 @@ What's New for OpenJPEG + : added October 20, 2011 +* [mickael] WIP: isolate dump test suite * [mickael] WIP: remove memory leak about new jp2_read_marker function * [mickael] WIP: remove previous commit about memory leak with ppm read function * [mickael] WIP: solve memory leak with ppm read function diff --git a/tests/nonregression/CMakeLists.txt b/tests/nonregression/CMakeLists.txt index 3e97304a..7cb65d3b 100644 --- a/tests/nonregression/CMakeLists.txt +++ b/tests/nonregression/CMakeLists.txt @@ -6,8 +6,10 @@ SET(TEMP ${CMAKE_CURRENT_BINARY_DIR}/Temporary) SET(BASELINE_NR ${OPJ_DATA_ROOT}/baseline/nonregression) SET(INPUT_NR ${OPJ_DATA_ROOT}/input/nonregression) + SET(INPUT_NR_PATH ${INPUT_NR}) SET(TEMP_PATH ${TEMP}) +SET(INPUT_CONF_PATH ${OPJ_DATA_ROOT}/input/conformance) # FIXME: should be corectly manage with a find kakadu IF (NOT WIN32) @@ -21,8 +23,61 @@ IF (REF_DECODER_NOTFOUND) MESSAGE(STATUS "REF_DECODER_BIN_PATH not found, if you want all the encoding tests suite please provide a regular path") ENDIF (REF_DECODER_NOTFOUND) + + + ######################################################################### -# GENERATION OF THE TEST SUITE +# GENERATION OF THE TEST SUITE (DUMP) +# Dump all files with the selected extension inside the input directory + +# Define a list of file which should be gracefully rejected: +SET(BLACKLIST_JPEG2000 + empty + ) + +FILE(GLOB_RECURSE OPJ_DATA_NR_LIST + "${INPUT_NR}/*.j2k" + "${INPUT_NR}/*.j2c" + "${INPUT_NR}/*.jp2" + #"${INPUT_NR}/*.jpx" + ) + +FOREACH(INPUT_FILENAME ${OPJ_DATA_NR_LIST}) + GET_FILENAME_COMPONENT(INPUT_FILENAME_NAME ${INPUT_FILENAME} NAME) + GET_FILENAME_COMPONENT(INPUT_FILENAME_NAME_WE ${INPUT_FILENAME_NAME} NAME_WE) + STRING(REGEX MATCH ${INPUT_FILENAME_NAME} bad_jpeg2000 ${BLACKLIST_JPEG2000}) + + # Dump the input image + ADD_TEST(NR-${INPUT_FILENAME_NAME}-dump + ${EXECUTABLE_OUTPUT_PATH}/j2k_dump + -i ${INPUT_FILENAME} + -o ${TEMP}/${INPUT_FILENAME_NAME}.txt + -v + ) + + IF(bad_jpeg2000) + SET_TESTS_PROPERTIES(NR-${INPUT_FILENAME_NAME}-dump + PROPERTIES WILL_FAIL TRUE) + + ELSE(bad_jpeg2000) + + # Compare the dump output with the baseline + ADD_TEST(NR-${INPUT_FILENAME_NAME}-compare_dump2base + ${EXECUTABLE_OUTPUT_PATH}/compare_dump_files + -b ${BASELINE_NR}/opj_v2_${INPUT_FILENAME_NAME_WE}.txt + -t ${TEMP}/${INPUT_FILENAME_NAME}.txt + ) + + SET_TESTS_PROPERTIES(NR-${INPUT_FILENAME_NAME}-compare_dump2base + PROPERTIES DEPENDS + NR-${INPUT_FILENAME_NAME}-dump) + ENDIF(bad_jpeg2000) + +ENDFOREACH(INPUT_FILENAME) + + +######################################################################### +# GENERATION OF THE TEST SUITE (DECODE AND ENCODE) # Read one and more input file(s) (located in ${OPJ_DATA_ROOT}/input/nonregression) # to know which files processed and with which options. @@ -270,25 +325,6 @@ FOREACH(OPJ_TEST_CMD_LINE ${OPJ_TEST_CMD_LINE_LIST}) # SET_TESTS_PROPERTIES(NR-${filename}-compare2base # PROPERTIES DEPENDS # NR-${filename}-decode) - - # Dump the input image - ADD_TEST(NR-DEC-${INPUT_FILENAME_NAME}-${IT_TEST_DEC}-dump - ${EXECUTABLE_OUTPUT_PATH}/j2k_dump - -i ${INPUT_FILENAME} - -o ${TEMP}/${INPUT_FILENAME_NAME}.txt - ) - - # Compare the dump output with the baseline - ADD_TEST(NR-DEC-${INPUT_FILENAME_NAME}-${IT_TEST_DEC}-compare_dump2base - ${EXECUTABLE_OUTPUT_PATH}/compare_dump_files - -b ${BASELINE_NR}/opj_v2_${INPUT_FILENAME_NAME_WE}.txt - -t ${TEMP}/${INPUT_FILENAME_NAME}.txt - ) - - SET_TESTS_PROPERTIES(NR-DEC-${INPUT_FILENAME_NAME}-${IT_TEST_DEC}-compare_dump2base - PROPERTIES DEPENDS - NR-DEC-${INPUT_FILENAME_NAME}-${IT_TEST_DEC}-dump) - ENDIF(FAILED_TEST_FOUND) diff --git a/tests/nonregression/test_suite.ctest.in b/tests/nonregression/test_suite.ctest.in index b1cba12a..178d4124 100644 --- a/tests/nonregression/test_suite.ctest.in +++ b/tests/nonregression/test_suite.ctest.in @@ -62,3 +62,20 @@ j2k_to_image -i @INPUT_NR_PATH@/relax.jp2 -o @TEMP_PATH@/relax.jp2.pgx j2k_to_image -i @INPUT_NR_PATH@/test_lossless.j2k -o @TEMP_PATH@/test_lossless.j2k.pgx # text_GBR.jp2 file exhibt a error about a tile part with a index > of the number of tile-part in this tile. !j2k_to_image -i @INPUT_NR_PATH@/text_GBR.jp2 -o @TEMP_PATH@/text_GBR.jp2.pgx + +# decode with specific area +# commented for the moment +#j2k_to_image -i @INPUT_CONF_PATH@/p1_04.j2k -o @TEMP_PATH@/p1_04.j2k.png -d 0,0,1024,1024 +#j2k_to_image -i @INPUT_CONF_PATH@/p1_04.j2k -o @TEMP_PATH@/p1_04_1.j2k.png -d 512,640,640,768 +#j2k_to_image -i @INPUT_CONF_PATH@/p1_04.j2k -o @TEMP_PATH@/p1_04_2.j2k.png -d 896,896,1024,1024 +#j2k_to_image -i @INPUT_CONF_PATH@/p1_04.j2k -o @TEMP_PATH@/p1_04_3.j2k.png -d 100,500,300,800 +#j2k_to_image -i @INPUT_CONF_PATH@/p1_04.j2k -o @TEMP_PATH@/p1_04_4.j2k.png -d 260,520,360,600 +#j2k_to_image -i @INPUT_CONF_PATH@/p1_04.j2k -o @TEMP_PATH@/p1_04_5.j2k.png -d 260,520,360,660 +#j2k_to_image -i @INPUT_CONF_PATH@/p1_04.j2k -o @TEMP_PATH@/p1_04_6.j2k.png -d 360,520,400,600 +#j2k_to_image -i @INPUT_CONF_PATH@/p1_04.j2k -o @TEMP_PATH@/p1_04_10.j2k.png -d 0,0,1024,1024 -r 2 +#j2k_to_image -i @INPUT_CONF_PATH@/p1_04.j2k -o @TEMP_PATH@/p1_04_11.j2k.png -d 512,640,640,768 -r 2 +#j2k_to_image -i @INPUT_CONF_PATH@/p1_04.j2k -o @TEMP_PATH@/p1_04_12.j2k.png -d 896,896,1024,1024 -r 2 +#j2k_to_image -i @INPUT_CONF_PATH@/p1_04.j2k -o @TEMP_PATH@/p1_04_13.j2k.png -d 100,500,300,800 -r 2 +#j2k_to_image -i @INPUT_CONF_PATH@/p1_04.j2k -o @TEMP_PATH@/p1_04_14.j2k.png -d 260,520,360,600 -r 2 +#j2k_to_image -i @INPUT_CONF_PATH@/p1_04.j2k -o @TEMP_PATH@/p1_04_15.j2k.png -d 260,520,360,660 -r 2 +#j2k_to_image -i @INPUT_CONF_PATH@/p1_04.j2k -o @TEMP_PATH@/p1_04_16.j2k.png -d 360,520,400,600 -r 2