From 8e70ae19570cedbebea8dd70ec9a7dbb787d6e97 Mon Sep 17 00:00:00 2001 From: Dmitry Kargin Date: Sun, 8 Nov 2020 19:05:44 +0300 Subject: [PATCH] APP tests are disabled if app is not built --- tests/CMakeLists.txt | 75 +++++++++++++++++++++++--------------------- 1 file changed, 39 insertions(+), 36 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 1d24c7a..dc9dc9f 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -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 + $ + ${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 - $ - ${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 + $ + ${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 - $ - ${block_size} - ${CMAKE_CURRENT_SOURCE_DIR}/${file_name} - ) -endforeach() +endif(ENABLE_APP) \ No newline at end of file