From abc2341cb40a3a94a0e911fd1b868845aec0baca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9B=D0=B5=D0=BE=D0=BD=D0=B8=D0=B4=20=D0=AE=D1=80=D1=8C?= =?UTF-8?q?=D0=B5=D0=B2=20=28Leonid=20Yuriev=29?= Date: Thu, 21 Apr 2022 20:25:04 +0300 Subject: [PATCH] cmake-test: avoid run tests in case cross-compilation without emulator. --- test/CMakeLists.txt | 104 ++++++++++++++++++++++++-------------------- 1 file changed, 56 insertions(+), 48 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 6758887a..87d07e27 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -67,53 +67,61 @@ endif() ################################################################################ -add_test(NAME smoke COMMAND ${MDBX_OUTPUT_DIR}/mdbx_test - --progress --console=no --pathname=smoke.db --dont-cleanup-after basic) -set_tests_properties(smoke PROPERTIES - TIMEOUT 600 - RUN_SERIAL OFF) -add_test(NAME smoke_chk COMMAND ${MDBX_OUTPUT_DIR}/mdbx_chk -nvv smoke.db) -set_tests_properties(smoke_chk PROPERTIES - DEPENDS smoke - TIMEOUT 60 - REQUIRED_FILES smoke.db) -add_test(NAME smoke_chk_copy COMMAND ${MDBX_OUTPUT_DIR}/mdbx_chk -nvv smoke.db-copy) -set_tests_properties(smoke_chk_copy PROPERTIES - DEPENDS smoke - TIMEOUT 60 - REQUIRED_FILES smoke.db-copy) +if (CMAKE_CROSSCOMPILING AND NOT CMAKE_CROSSCOMPILING_EMULATOR) + message(WARNING "No emulator to run cross-compiled tests") + add_test(NAME fake_since_no_crosscompiling_emulator COMMAND ${CMAKE_COMMAND} -E + echo "No emulator to run cross-compiled tests") +else() -add_test(NAME dupsort_writemap COMMAND ${MDBX_OUTPUT_DIR}/mdbx_test - --loglevel=notice - --table=+data.integer --keygen.split=29 --datalen.min=min --datalen.max=max --progress --console=no - --repeat=2 --pathname=dupsort_writemap.db --dont-cleanup-after basic) -set_tests_properties(dupsort_writemap PROPERTIES - TIMEOUT 600 - RUN_SERIAL OFF) -add_test(NAME dupsort_writemap_chk COMMAND ${MDBX_OUTPUT_DIR}/mdbx_chk -nvv dupsort_writemap.db) -set_tests_properties(dupsort_writemap_chk PROPERTIES - DEPENDS dupsort_writemap - TIMEOUT 60 - REQUIRED_FILES dupsort_writemap.db) -add_test(NAME dupsort_writemap_chk_copy COMMAND ${MDBX_OUTPUT_DIR}/mdbx_chk -nvv dupsort_writemap.db-copy) -set_tests_properties(dupsort_writemap_chk_copy PROPERTIES - DEPENDS dupsort_writemap - TIMEOUT 60 - REQUIRED_FILES dupsort_writemap.db-copy) + add_test(NAME smoke COMMAND ${MDBX_OUTPUT_DIR}/mdbx_test + --progress --console=no --pathname=smoke.db --dont-cleanup-after basic) + set_tests_properties(smoke PROPERTIES + TIMEOUT 600 + RUN_SERIAL OFF) + add_test(NAME smoke_chk COMMAND ${MDBX_OUTPUT_DIR}/mdbx_chk -nvv smoke.db) + set_tests_properties(smoke_chk PROPERTIES + DEPENDS smoke + TIMEOUT 60 + REQUIRED_FILES smoke.db) + add_test(NAME smoke_chk_copy COMMAND ${MDBX_OUTPUT_DIR}/mdbx_chk -nvv smoke.db-copy) + set_tests_properties(smoke_chk_copy PROPERTIES + DEPENDS smoke + TIMEOUT 60 + REQUIRED_FILES smoke.db-copy) -add_test(NAME uniq_nested COMMAND ${MDBX_OUTPUT_DIR}/mdbx_test - --loglevel=notice - --mode=-writemap,-nosync-safe,-lifo --progress --console=no --repeat=2 --pathname=uniq_nested.db --dont-cleanup-after basic) -set_tests_properties(uniq_nested PROPERTIES - TIMEOUT 1800 - RUN_SERIAL OFF) -add_test(NAME uniq_nested_chk COMMAND ${MDBX_OUTPUT_DIR}/mdbx_chk -nvv uniq_nested.db) -set_tests_properties(uniq_nested_chk PROPERTIES - DEPENDS uniq_nested - TIMEOUT 60 - REQUIRED_FILES uniq_nested.db) -add_test(NAME uniq_nested_chk_copy COMMAND ${MDBX_OUTPUT_DIR}/mdbx_chk -nvv uniq_nested.db-copy) -set_tests_properties(uniq_nested_chk_copy PROPERTIES - DEPENDS uniq_nested - TIMEOUT 60 - REQUIRED_FILES uniq_nested.db-copy) + add_test(NAME dupsort_writemap COMMAND ${MDBX_OUTPUT_DIR}/mdbx_test + --loglevel=notice + --table=+data.integer --keygen.split=29 --datalen.min=min --datalen.max=max --progress --console=no + --repeat=2 --pathname=dupsort_writemap.db --dont-cleanup-after basic) + set_tests_properties(dupsort_writemap PROPERTIES + TIMEOUT 600 + RUN_SERIAL OFF) + add_test(NAME dupsort_writemap_chk COMMAND ${MDBX_OUTPUT_DIR}/mdbx_chk -nvv dupsort_writemap.db) + set_tests_properties(dupsort_writemap_chk PROPERTIES + DEPENDS dupsort_writemap + TIMEOUT 60 + REQUIRED_FILES dupsort_writemap.db) + add_test(NAME dupsort_writemap_chk_copy COMMAND ${MDBX_OUTPUT_DIR}/mdbx_chk -nvv dupsort_writemap.db-copy) + set_tests_properties(dupsort_writemap_chk_copy PROPERTIES + DEPENDS dupsort_writemap + TIMEOUT 60 + REQUIRED_FILES dupsort_writemap.db-copy) + + add_test(NAME uniq_nested COMMAND ${MDBX_OUTPUT_DIR}/mdbx_test + --loglevel=notice + --mode=-writemap,-nosync-safe,-lifo --progress --console=no --repeat=2 --pathname=uniq_nested.db --dont-cleanup-after basic) + set_tests_properties(uniq_nested PROPERTIES + TIMEOUT 1800 + RUN_SERIAL OFF) + add_test(NAME uniq_nested_chk COMMAND ${MDBX_OUTPUT_DIR}/mdbx_chk -nvv uniq_nested.db) + set_tests_properties(uniq_nested_chk PROPERTIES + DEPENDS uniq_nested + TIMEOUT 60 + REQUIRED_FILES uniq_nested.db) + add_test(NAME uniq_nested_chk_copy COMMAND ${MDBX_OUTPUT_DIR}/mdbx_chk -nvv uniq_nested.db-copy) + set_tests_properties(uniq_nested_chk_copy PROPERTIES + DEPENDS uniq_nested + TIMEOUT 60 + REQUIRED_FILES uniq_nested.db-copy) + +endif()