mirror of
https://github.com/gbdev/rgbds.git
synced 2026-07-02 05:58:04 +00:00
Refactor the test harness for external repo tests (#1994)
- Use CTest labels to filter tests ("internal"/"external", "free"/"nonfree",
and individual tool+project names) instead of defining `TESTS_RUN_NONFREE`
- Allow each external test to run independently in CTest
- Remove the unused no-op `fetch-test-deps.sh --only-internal` option
This commit is contained in:
+7
-25
@@ -39,7 +39,6 @@ while [[ $# -gt 0 ]]; do
|
||||
;;
|
||||
--only-internal)
|
||||
external=false
|
||||
FETCH_TEST_DEPS="$FETCH_TEST_DEPS --only-internal"
|
||||
;;
|
||||
--only-external)
|
||||
internal=false
|
||||
@@ -109,35 +108,18 @@ fi
|
||||
|
||||
# Test some significant external projects that use RGBDS
|
||||
# When adding new ones, don't forget to add them to the .gitignore!
|
||||
# When updating subprojects, change the commit being checked out, and set the `shallow-since`
|
||||
# to the day before, to reduce the amount of refs being transferred and thus speed up CI.
|
||||
|
||||
test_downstream() { # owner repo make-target build-file build-hash
|
||||
if ! pushd "$2"; then
|
||||
echo >&2 'Please run `'"$FETCH_TEST_DEPS"'` before running the test suite'
|
||||
return 1
|
||||
fi
|
||||
make clean $RGBDS_PATH
|
||||
make -j4 "$3" $RGBDS_PATH
|
||||
hash="$(sha1sum -b "$4" | head -c 40)"
|
||||
if [ "$hash" != "$5" ]; then
|
||||
echo >&2 'SHA-1 hash of '"$4"' did not match: '"$hash"
|
||||
return 1
|
||||
fi
|
||||
popd
|
||||
}
|
||||
|
||||
if "$nonfree"; then
|
||||
test_downstream pret pokecrystal compare pokecrystal.gbc f4cd194bdee0d04ca4eac29e09b8e4e9d818c133
|
||||
test_downstream pret pokered compare pokered.gbc ea9bcae617fdf159b045185467ae58b2e4a48b9a
|
||||
test_downstream zladx LADX-Disassembly default azle.gbc d90ac17e9bf17b6c61624ad9f05447bdb5efc01a
|
||||
./external/test.sh pokecrystal
|
||||
./external/test.sh pokered
|
||||
./external/test.sh ladx
|
||||
fi
|
||||
test_downstream AntonioND ucity all ucity.gbc 5f026649611c9606ce0bf70dc1552e054e7df5bc
|
||||
test_downstream pinobatch libbet all libbet.gb f117089aa056600e2d404bbcbac96b016fc64611
|
||||
test_downstream LIJI32 SameBoy bootroms build/bin/BootROMs/cgb_boot.bin 113903775a9d34b798c2f8076672da6626815a91
|
||||
./external/test.sh ucity
|
||||
./external/test.sh libbet
|
||||
./external/test.sh sameboy
|
||||
# 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
|
||||
case "${osname%%-*}" in
|
||||
windows | macos | *bsd) ;;
|
||||
*) test_downstream ISSOtm gb-starter-kit all bin/boilerplate.gb b4f130169ba73284e0d0e71b53e7baa4eca2f7fe;;
|
||||
*) ./external/test.sh gb-starter-kit
|
||||
esac
|
||||
|
||||
Reference in New Issue
Block a user