Merge branch 'skip_tests_if_no_app' into 'master'

APP tests are disabled if app is not built

See merge request federicomenaquintero/bzip2!37
This commit is contained in:
Micah 2021-05-24 01:35:02 +00:00
commit 775be3c894

View File

@ -1,41 +1,44 @@
set(sample1 -1 sample1.ref sample1.bz2)
set(sample2 -1 sample2.ref sample2.bz2)
set(sample3 -1 sample3.ref sample3.bz2)
if (ENABLE_APP)
set(sample1 -1 sample1.ref sample1.bz2)
set(sample2 -1 sample2.ref sample2.bz2)
set(sample3 -1 sample3.ref sample3.bz2)
foreach(TEST
"${sample1}"
"${sample2}"
"${sample3}"
)
foreach(TEST
"${sample1}"
"${sample2}"
"${sample3}"
)
list(GET TEST 0 block_size)
list(GET TEST 1 file_name)
list(GET TEST 2 zip_name)
add_test(NAME "compress_${file_name}"
COMMAND ${Python3_EXECUTABLE}
${CMAKE_CURRENT_SOURCE_DIR}/runtest.py
--mode compress
$<TARGET_FILE:bzip2>
${block_size}
${CMAKE_CURRENT_SOURCE_DIR}/${file_name}
${CMAKE_CURRENT_SOURCE_DIR}/${zip_name}
)
endforeach()
foreach(TEST
"${sample1}"
"${sample2}"
"${sample3}"
)
list(GET TEST 0 block_size)
list(GET TEST 1 file_name)
list(GET TEST 2 zip_name)
add_test(NAME "compress_${file_name}"
COMMAND ${Python3_EXECUTABLE}
${CMAKE_CURRENT_SOURCE_DIR}/runtest.py
--mode compress
$<TARGET_FILE:bzip2>
${block_size}
${CMAKE_CURRENT_SOURCE_DIR}/${file_name}
${CMAKE_CURRENT_SOURCE_DIR}/${zip_name}
)
endforeach()
add_test(NAME "decompress_${file_name}"
COMMAND ${Python3_EXECUTABLE}
${CMAKE_CURRENT_SOURCE_DIR}/runtest.py
--mode decompress
$<TARGET_FILE:bzip2>
${block_size}
${CMAKE_CURRENT_SOURCE_DIR}/${file_name}
)
endforeach()
foreach(TEST
"${sample1}"
"${sample2}"
"${sample3}"
)
list(GET TEST 0 block_size)
list(GET TEST 1 file_name)
add_test(NAME "decompress_${file_name}"
COMMAND ${Python3_EXECUTABLE}
${CMAKE_CURRENT_SOURCE_DIR}/runtest.py
--mode decompress
$<TARGET_FILE:bzip2>
${block_size}
${CMAKE_CURRENT_SOURCE_DIR}/${file_name}
)
endforeach()
endif(ENABLE_APP)