Replace TJExample with IJG workalike programs

This commit is contained in:
DRC
2024-08-20 18:52:53 -04:00
parent 6d9f1f816c
commit fad6100704
28 changed files with 2626 additions and 1034 deletions

View File

@@ -40,7 +40,9 @@ file(GLOB FILES
*_LOSSL*S_*.jpg
croptest.log
tjbenchtest*.log
tjexampletest*.log)
tjcomptest*.log
tjdecomptest*.log
tjtrantest*.log)
if(NOT FILES STREQUAL "")
message(STATUS "Removing test files")

View File

@@ -45,9 +45,6 @@ if(PRECISION EQUAL 8)
endif()
run_test(tjbenchtest "-precision;${PRECISION};-lossless")
run_test(tjbenchtest "-precision;${PRECISION};-lossless;-alloc")
if(PRECISION EQUAL 8)
run_test(tjexampletest "")
endif()
if(WITH_JAVA)
if(PRECISION EQUAL 8 OR PRECISION EQUAL 12)
run_test(tjbenchtest "-java;-precision;${PRECISION}")
@@ -71,7 +68,4 @@ if(WITH_JAVA)
run_test(tjbenchtest "-java;-precision;${PRECISION};-arithmetic;-yuv")
endif()
run_test(tjbenchtest "-java;-precision;${PRECISION};-lossless")
if(PRECISION EQUAL 8)
run_test(tjexampletest "-java")
endif()
endif()

View File

@@ -0,0 +1,26 @@
if(NOT DEFINED WITH_JAVA)
message(FATAL_ERROR "WITH_JAVA must be specified")
endif()
macro(check_error program)
if(NOT RESULT EQUAL 0)
message(FATAL_ERROR "${program} failed.")
endif()
endmacro()
macro(run_test PROG ARGS)
string(REPLACE ";" " " SPACED_ARGS "${ARGS}")
message(STATUS "${PROG} ${SPACED_ARGS}")
execute_process(COMMAND ${CMAKE_CURRENT_BINARY_DIR}/test/${PROG} ${ARGS}
RESULT_VARIABLE RESULT)
check_error("${PROG} ${SPACED_ARGS}")
endmacro()
run_test(tjcomptest "")
run_test(tjdecomptest "")
run_test(tjtrantest "")
if(WITH_JAVA)
run_test(tjcomptest "-java")
run_test(tjdecomptest "-java")
run_test(tjtrantest "-java")
endif()