2012-03-02 16:09:51 +01:00
# Tests
2012-08-30 19:14:39 +02:00
include_directories (
2012-10-01 12:20:31 +02:00
$ { O P E N J P E G _ B I N A R Y _ D I R } / s r c / l i b / o p e n j p 2 # opj_config.h
2012-09-28 10:11:41 +02:00
$ { O P E N J P E G _ S O U R C E _ D I R } / s r c / l i b / o p e n j p 2
$ { O P E N J P E G _ S O U R C E _ D I R } / s r c / b i n / j p 2
$ { O P E N J P E G _ S O U R C E _ D I R } / s r c / b i n / c o m m o n
2012-03-02 16:09:51 +01:00
$ { Z _ I N C L U D E _ D I R N A M E }
$ { P N G _ I N C L U D E _ D I R N A M E }
$ { T I F F _ I N C L U D E _ D I R N A M E }
)
2011-07-21 17:23:31 +02:00
# First thing define the common source:
2012-08-30 19:14:39 +02:00
set ( comparePGXimages_SRCS comparePGXimages.c
2012-09-28 10:11:41 +02:00
$ { O P E N J P E G _ S O U R C E _ D I R } / s r c / b i n / j p 2 / c o n v e r t . c
$ { O P E N J P E G _ S O U R C E _ D I R } / s r c / b i n / c o m m o n / o p j _ g e t o p t . c
2012-03-02 16:09:51 +01:00
)
2011-09-01 13:24:08 +02:00
2012-08-30 19:14:39 +02:00
set ( compare_dump_files_SRCS compare_dump_files.c
2012-09-28 10:11:41 +02:00
$ { O P E N J P E G _ S O U R C E _ D I R } / s r c / b i n / c o m m o n / o p j _ g e t o p t . c )
2011-09-01 13:24:08 +02:00
2012-08-30 19:14:39 +02:00
set ( compareRAWimages_SRCS compareRAWimages.c
2012-09-28 10:11:41 +02:00
$ { O P E N J P E G _ S O U R C E _ D I R } / s r c / b i n / c o m m o n / o p j _ g e t o p t . c )
2011-07-21 17:23:31 +02:00
2012-08-30 19:14:39 +02:00
add_executable ( comparePGXimages ${ comparePGXimages_SRCS } )
target_link_libraries ( comparePGXimages
2012-03-02 16:09:51 +01:00
$ { O P E N J P E G _ L I B R A R Y _ N A M E }
$ { P N G _ L I B N A M E } $ { T I F F _ L I B N A M E }
)
# To support universal exe:
2012-08-30 19:14:39 +02:00
if ( ZLIB_FOUND AND APPLE )
target_link_libraries ( comparePGXimages z )
2012-10-01 14:29:09 +02:00
else ( ZLIB_FOUND AND APPLE )
2012-08-30 19:14:39 +02:00
target_link_libraries ( comparePGXimages ${ Z_LIBNAME } )
2012-08-30 19:20:03 +02:00
endif ( )
2012-03-02 16:09:51 +01:00
2012-08-30 19:14:39 +02:00
add_executable ( compare_dump_files ${ compare_dump_files_SRCS } )
2011-07-21 17:23:31 +02:00
2012-08-30 19:14:39 +02:00
add_executable ( j2k_random_tile_access j2k_random_tile_access.c )
target_link_libraries ( j2k_random_tile_access ${ OPENJPEG_LIBRARY_NAME } )
2011-11-30 17:55:25 +01:00
2012-08-30 19:14:39 +02:00
add_executable ( compareRAWimages ${ compareRAWimages_SRCS } )
2011-08-31 15:33:40 +02:00
2012-08-30 19:14:39 +02:00
add_executable ( test_tile_encoder test_tile_encoder.c )
target_link_libraries ( test_tile_encoder ${ OPENJPEG_LIBRARY_NAME } )
2012-03-23 18:47:53 +01:00
2012-05-14 18:05:55 +02:00
# Let's try a couple of possibilities:
2012-08-30 19:14:39 +02:00
add_test ( tte0 ${ EXECUTABLE_OUTPUT_PATH } /test_tile_encoder )
add_test ( tte1 ${ EXECUTABLE_OUTPUT_PATH } /test_tile_encoder 3 2048 2048 1024 1024 8 1 tte1.j2k )
add_test ( tte2 ${ EXECUTABLE_OUTPUT_PATH } /test_tile_encoder 3 2048 2048 1024 1024 8 1 tte2.jp2 )
add_test ( tte3 ${ EXECUTABLE_OUTPUT_PATH } /test_tile_encoder 1 2048 2048 1024 1024 8 1 tte3.j2k )
add_test ( tte4 ${ EXECUTABLE_OUTPUT_PATH } /test_tile_encoder 1 256 256 128 128 8 0 tte4.j2k )
add_test ( tte5 ${ EXECUTABLE_OUTPUT_PATH } /test_tile_encoder 1 512 512 256 256 8 0 tte5.j2k )
2012-10-15 17:47:56 +02:00
#add_test(tte6 ${EXECUTABLE_OUTPUT_PATH}/test_tile_encoder 1 8192 8192 512 512 8 0 tte6.j2k)
#add_test(tte7 ${EXECUTABLE_OUTPUT_PATH}/test_tile_encoder 1 32768 32768 512 512 8 0 tte7.jp2)
2012-05-14 18:05:55 +02:00
2012-08-30 19:14:39 +02:00
add_executable ( test_tile_decoder test_tile_decoder.c )
target_link_libraries ( test_tile_decoder ${ OPENJPEG_LIBRARY_NAME } )
2012-05-14 09:03:33 +02:00
2012-08-30 19:14:39 +02:00
add_test ( ttd0 ${ EXECUTABLE_OUTPUT_PATH } /test_tile_decoder )
2012-05-21 10:03:58 +02:00
set_property ( TEST ttd0 APPEND PROPERTY DEPENDS tte0 )
2012-08-30 19:14:39 +02:00
add_test ( ttd1 ${ EXECUTABLE_OUTPUT_PATH } /test_tile_decoder 0 0 1024 1024 tte1.j2k )
2012-05-21 10:03:58 +02:00
set_property ( TEST ttd1 APPEND PROPERTY DEPENDS tte1 )
2012-08-30 19:14:39 +02:00
add_test ( ttd2 ${ EXECUTABLE_OUTPUT_PATH } /test_tile_decoder 0 0 1024 1024 tte2.jp2 )
2012-05-21 10:03:58 +02:00
set_property ( TEST ttd2 APPEND PROPERTY DEPENDS tte2 )
2012-10-15 17:47:56 +02:00
#add_test(ttd6 ${EXECUTABLE_OUTPUT_PATH}/test_tile_decoder 0 0 512 512 tte6.j2k)
#set_property(TEST ttd6 APPEND PROPERTY DEPENDS tte6)
#add_test(ttd7 ${EXECUTABLE_OUTPUT_PATH}/test_tile_decoder 0 0 512 512 tte7.jp2)
#set_property(TEST ttd7 APPEND PROPERTY DEPENDS tte7)
2012-05-21 10:03:58 +02:00
2011-07-21 17:23:31 +02:00
# No image send to the dashboard if lib PNG is not available.
2012-08-30 19:14:39 +02:00
if ( NOT HAVE_LIBPNG )
2012-08-30 19:20:03 +02:00
message ( WARNING "Lib PNG seems to be not available: if you want run the non-regression tests with images reported to the dashboard, you need it (try BUILD_THIRDPARTY)" )
endif ( )
2011-07-21 17:23:31 +02:00
2012-08-30 19:14:39 +02:00
add_subdirectory ( conformance )
add_subdirectory ( nonregression )
2012-10-01 14:26:27 +02:00
add_subdirectory ( unit )
2012-03-02 16:09:51 +01:00
2012-08-30 19:14:39 +02:00
if ( BUILD_JPIP )
if ( JPIP_SERVER )
#set(s "http://jpip.example.com/myFCGI?target=16.jp2&fsiz=170,170&cnew=http&type=jpp-stream")
set ( s "${JPIP_SERVER}?target=16.jp2&fsiz=170,170&cnew=http&type=jpp-stream" )
set ( p "${CMAKE_CURRENT_BINARY_DIR}/jpip.dat" )
set ( md5 "62b00c620fb0a600c5ffd413cada4674" )
add_test ( TestJPIP1 ${ CMAKE_COMMAND } -DD_URL:STRING= ${ s } -DD_FILE:PATH= ${ p }
2012-03-02 16:09:51 +01:00
- D E X P E C T E D _ M D 5 = $ { m d 5 } - P $ { P R O J E C T _ S O U R C E _ D I R } / C M a k e / J P I P T e s t D r i v e r . c m a k e )
2012-08-30 19:20:03 +02:00
endif ( )
endif ( )