From 996db14ffa94ce0feb3e916f0f09a0249f720afd Mon Sep 17 00:00:00 2001 From: Sylvie <35663410+Rangi42@users.noreply.github.com> Date: Fri, 29 Mar 2024 11:59:36 -0400 Subject: [PATCH] Make test built of 'libbet' reproducible with old Pillow versions (#1385) The Python Pillow image library gives different output for `Image.getcolors()` in version 9 than version 10. This causes libbet's SGB border to be built differently, giving a different ROM hash and technically failing the test script. This patches libbet to only keep the known-good colors. It also adapts the coverage script to run all the tests, including building the third-party projects. --- contrib/coverage.bash | 9 ++++----- test/patches/libbet.patch | 13 +++++++++++++ 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/contrib/coverage.bash b/contrib/coverage.bash index 2784604d..13c3bffc 100755 --- a/contrib/coverage.bash +++ b/contrib/coverage.bash @@ -5,11 +5,10 @@ set -e make coverage -j # Run the tests -for dir in asm link fix gfx; do - pushd test/$dir - ./test.sh - popd -done +pushd test +./fetch-test-deps.sh +./run-tests.sh +popd # Generate coverage logs gcov src/**/*.cpp diff --git a/test/patches/libbet.patch b/test/patches/libbet.patch index 36671a5d..02596ffb 100644 --- a/test/patches/libbet.patch +++ b/test/patches/libbet.patch @@ -24,3 +24,16 @@ index 6513518..ba14638 100644 $(PY) $^ -o $@ # Graphics conversion +diff --git a/tools/makeborder.py b/tools/makeborder.py +index b9fa3f1..dfe5789 100755 +--- a/tools/makeborder.py ++++ b/tools/makeborder.py +@@ -88,7 +88,7 @@ def main(argv=None): + else: + iutmrows = b''.join(pb16.pb16(b''.join(utmrows))) + +- palette = im.getpalette()[:48] ++ palette = im.getpalette()[:12] + palette.extend(bytes(48 - len(palette))) + snespalette = bytearray() + for i in range(0, 48, 3):