Make sure to init all variables involved in CMake tests

This commit is contained in:
ISSOtm
2026-03-09 03:20:37 -04:00
committed by Rangi
parent 676db46c01
commit 6270f654a1
3 changed files with 13 additions and 6 deletions

View File

@@ -383,7 +383,7 @@ jobs:
git \ git \
png png
run: | # FreeBSD `c++` compiler does not support `make develop` sanitizers ASan or UBSan run: | # FreeBSD `c++` compiler does not support `make develop` sanitizers ASan or UBSan
cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_COMPILER=c++ -DUSE_EXTERNAL_TESTS=OFF -DOS=bsd cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_COMPILER=c++ -DUSE_EXTERNAL_TESTS=OFF -DTESTS_OS_NAME=bsd
cmake --build build -j4 --verbose cmake --build build -j4 --verbose
cmake --install build --verbose cmake --install build --verbose
cmake --build build --target test cmake --build build --target test

View File

@@ -2,15 +2,21 @@
option(USE_NONFREE_TESTS "run tests that build nonfree codebases" ON) option(USE_NONFREE_TESTS "run tests that build nonfree codebases" ON)
option(USE_EXTERNAL_TESTS "run tests that build external codebases" ON) option(USE_EXTERNAL_TESTS "run tests that build external codebases" ON)
set(TESTS_OS_NAME "" CACHE STRING "skip running tests known to fail on this OS")
set(ONLY_FREE)
if(NOT USE_NONFREE_TESTS) if(NOT USE_NONFREE_TESTS)
set(ONLY_FREE "--only-free") set(ONLY_FREE "--only-free")
endif() endif()
set(ONLY_INTERNAL)
if(NOT USE_EXTERNAL_TESTS) if(NOT USE_EXTERNAL_TESTS)
set(ONLY_INTERNAL "--only-internal") set(ONLY_INTERNAL "--only-internal")
endif() endif()
if(DEFINED OS)
set(OS_NAME "--os" "${OS}") set(OS_NAME)
if(NOT TESTS_OS_NAME STREQUAL "")
set(OS_NAME "--os" "${TESTS_OS_NAME}")
endif() endif()
add_executable(randtilegen gfx/randtilegen.cpp) add_executable(randtilegen gfx/randtilegen.cpp)

View File

@@ -134,6 +134,7 @@ test_downstream pinobatch libbet all libbet.gb f117089aa056600e2d404bbcbac
test_downstream LIJI32 SameBoy bootroms build/bin/BootROMs/cgb_boot.bin 113903775a9d34b798c2f8076672da6626815a91 test_downstream LIJI32 SameBoy bootroms build/bin/BootROMs/cgb_boot.bin 113903775a9d34b798c2f8076672da6626815a91
# gb-starter kit fails with any `make` on Windows: https://codeberg.org/ISSOtm/gb-starter-kit/issues/1 # gb-starter kit fails with any `make` on Windows: https://codeberg.org/ISSOtm/gb-starter-kit/issues/1
# gb-starter-kit fails with macOS/BSD `make`: https://codeberg.org/ISSOtm/gb-starter-kit/issues/29 # gb-starter-kit fails with macOS/BSD `make`: https://codeberg.org/ISSOtm/gb-starter-kit/issues/29
if [[ "${osname%-*}" != "windows" && "${osname%-*}" != "macos" && "${osname%-*}" != "bsd" ]]; then case "${osname%%-*}" in
test_downstream ISSOtm gb-starter-kit all bin/boilerplate.gb b4f130169ba73284e0d0e71b53e7baa4eca2f7fe windows | macos | bsd) ;;
fi *) test_downstream ISSOtm gb-starter-kit all bin/boilerplate.gb b4f130169ba73284e0d0e71b53e7baa4eca2f7fe;;
esac