build: disable tools test unless we have mkdwarfs, dwarfs{ck,extract}

This commit is contained in:
Marcus Holland-Moritz 2024-08-12 22:14:46 +02:00
parent a4b851e93e
commit ca09955e12
2 changed files with 14 additions and 10 deletions

View File

@ -440,10 +440,17 @@ if(WITH_TESTS)
endif() endif()
if(WITH_TOOLS OR WITH_FUSE_DRIVER) if(WITH_TOOLS OR WITH_FUSE_DRIVER)
if(NOT WITH_TOOLS)
find_program(MKDWARFS_EXE mkdwarfs mkdwarfs.exe)
find_program(DWARFSCK_EXE dwarfsck dwarfsck.exe)
find_program(DWARFSEXTRACT_EXE dwarfsextract dwarfsextract.exe)
endif()
if(WITH_TOOLS OR (MKDWARFS_EXE AND DWARFSCK_EXE AND DWARFSEXTRACT_EXE))
list(APPEND DWARFS_TESTS list(APPEND DWARFS_TESTS
tools_test tools_test
) )
endif() endif()
endif()
if((WITH_TOOLS OR WITH_FUSE_DRIVER) AND WITH_MAN_OPTION) if((WITH_TOOLS OR WITH_FUSE_DRIVER) AND WITH_MAN_OPTION)
list(APPEND DWARFS_TESTS manpage_test) list(APPEND DWARFS_TESTS manpage_test)
@ -480,11 +487,6 @@ if(WITH_TESTS)
endif() endif()
if(TARGET tools_test) if(TARGET tools_test)
if(NOT WITH_TOOLS)
find_program(MKDWARFS_EXE mkdwarfs mkdwarfs.exe)
find_program(DWARFSCK_EXE dwarfsck dwarfsck.exe)
find_program(DWARFSEXTRACT_EXE dwarfsextract dwarfsextract.exe)
endif()
target_compile_definitions(tools_test PRIVATE target_compile_definitions(tools_test PRIVATE
$<$<AND:$<BOOL:${WITH_UNIVERSAL_BINARY}>,$<BOOL:${WITH_TOOLS}>>:DWARFS_HAVE_UNIVERSAL_BINARY> $<$<AND:$<BOOL:${WITH_UNIVERSAL_BINARY}>,$<BOOL:${WITH_TOOLS}>>:DWARFS_HAVE_UNIVERSAL_BINARY>
$<$<BOOL:${WITH_TOOLS}>:DWARFS_WITH_TOOLS> $<$<BOOL:${WITH_TOOLS}>:DWARFS_WITH_TOOLS>

View File

@ -1636,7 +1636,9 @@ class manpage_test
: public ::testing::TestWithParam<std::tuple<binary_mode, std::string>> {}; : public ::testing::TestWithParam<std::tuple<binary_mode, std::string>> {};
std::vector<std::string> const manpage_test_tools{ std::vector<std::string> const manpage_test_tools{
"mkdwarfs", "dwarfsck", "dwarfsextract", "mkdwarfs",
"dwarfsck",
"dwarfsextract",
#ifdef DWARFS_WITH_FUSE_DRIVER #ifdef DWARFS_WITH_FUSE_DRIVER
"dwarfs", "dwarfs",
#endif #endif