mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
Run internal tests in FreeBSD (#1616)
This commit is contained in:
27
.github/workflows/testing.yml
vendored
27
.github/workflows/testing.yml
vendored
@@ -354,6 +354,29 @@ jobs:
|
||||
make install -j Q=
|
||||
- name: Run tests
|
||||
shell: C:\cygwin\bin\env.exe CYGWIN_NOWINPATH=1 CHERE_INVOKING=1 C:\cygwin\bin\bash.exe -o igncr '{0}'
|
||||
run: | # Allow asm/test.sh to run `git describe` for the version test
|
||||
git config --global --add safe.directory '*'
|
||||
run: |
|
||||
test/run-tests.sh --only-internal
|
||||
|
||||
freebsd:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v4
|
||||
- name: Build & test using CMake on FreeBSD
|
||||
uses: vmactions/freebsd-vm@v1
|
||||
with:
|
||||
release: "15.0"
|
||||
usesh: true
|
||||
prepare: |
|
||||
pkg install -y \
|
||||
bash \
|
||||
bison \
|
||||
cmake \
|
||||
git \
|
||||
png
|
||||
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
|
||||
cmake --build build -j4 --verbose
|
||||
cmake --install build --verbose
|
||||
cmake --build build --target test
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
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)
|
||||
|
||||
if(NOT USE_NONFREE_TESTS)
|
||||
set(ONLY_FREE "--only-free")
|
||||
endif()
|
||||
if(NOT USE_EXTERNAL_TESTS)
|
||||
set(ONLY_INTERNAL "--only-internal")
|
||||
endif()
|
||||
|
||||
add_executable(randtilegen gfx/randtilegen.cpp)
|
||||
add_executable(rgbgfx_test gfx/rgbgfx_test.cpp)
|
||||
@@ -27,6 +31,6 @@ foreach(TARGET randtilegen rgbgfx_test)
|
||||
endforeach()
|
||||
|
||||
add_test(NAME all
|
||||
COMMAND ./run-tests.sh ${ONLY_FREE}
|
||||
COMMAND ./run-tests.sh ${ONLY_FREE} ${ONLY_INTERNAL}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
@@ -1 +1 @@
|
||||
set(CTEST_CUSTOM_PRE_TEST "bash -c 'cd @CMAKE_CURRENT_SOURCE_DIR@\; ./fetch-test-deps.sh @ONLY_FREE@'")
|
||||
set(CTEST_CUSTOM_PRE_TEST "bash -c 'cd @CMAKE_CURRENT_SOURCE_DIR@\; ./fetch-test-deps.sh @ONLY_FREE@ @ONLY_INTERNAL@'")
|
||||
|
||||
@@ -6,16 +6,18 @@ cd "$(dirname "$0")"
|
||||
usage() {
|
||||
echo "Downloads source code of Game Boy programs used as RGBDS test cases."
|
||||
echo "Options:"
|
||||
echo " -h, --help show this help message"
|
||||
echo " --only-free download only freely licensed codebases"
|
||||
echo " --get-deps install programs' own dependencies instead of themselves"
|
||||
echo " --get-hash print programs' commit hashes instead of downloading them"
|
||||
echo " --get-paths print programs' GitHub paths instead of downloading them"
|
||||
echo " -h, --help show this help message"
|
||||
echo " --only-free download only freely licensed codebases"
|
||||
echo " --only-internal do not download any codebases"
|
||||
echo " --get-deps install programs' own dependencies instead of themselves"
|
||||
echo " --get-hash print programs' commit hashes instead of downloading them"
|
||||
echo " --get-paths print programs' GitHub paths instead of downloading them"
|
||||
}
|
||||
|
||||
# Parse options in pure Bash because macOS `getopt` is stuck
|
||||
# in what util-linux `getopt` calls `GETOPT_COMPATIBLE` mode
|
||||
nonfree=true
|
||||
external=true
|
||||
actionname=
|
||||
osname=
|
||||
while [[ $# -gt 0 ]]; do
|
||||
@@ -27,6 +29,9 @@ while [[ $# -gt 0 ]]; do
|
||||
--only-free)
|
||||
nonfree=false
|
||||
;;
|
||||
--only-internal)
|
||||
external=false
|
||||
;;
|
||||
--get-deps)
|
||||
actionname="$1"
|
||||
shift
|
||||
@@ -97,6 +102,10 @@ case "$actionname" in
|
||||
}
|
||||
esac
|
||||
|
||||
if ! "$external"; then
|
||||
exit
|
||||
fi
|
||||
|
||||
if "$nonfree"; then
|
||||
action pret pokecrystal 2024-12-28 86a87a355e6805663cfecf150a3af71c66441a3e
|
||||
action pret pokered 2024-12-26 f023c68417ff0b14db1ab28ecff67f8d123ede44
|
||||
|
||||
@@ -24,10 +24,11 @@ while [[ $# -gt 0 ]]; do
|
||||
;;
|
||||
--only-free)
|
||||
nonfree=false
|
||||
FETCH_TEST_DEPS="fetch-test-deps.sh --only-free"
|
||||
FETCH_TEST_DEPS="$FETCH_TEST_DEPS --only-free"
|
||||
;;
|
||||
--only-internal)
|
||||
external=false
|
||||
FETCH_TEST_DEPS="$FETCH_TEST_DEPS --only-internal"
|
||||
;;
|
||||
--)
|
||||
break
|
||||
|
||||
Reference in New Issue
Block a user