mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
Verify ROM hashes for all CI test projects (#1384)
Ucity and Libbet build files in a nondeterministic order, which we have to patch to sort consistently for reproducible builds.
This commit is contained in:
@@ -152,5 +152,5 @@ If one *does* exist, RGBGFX's return status is ignored, but its output **must**
|
|||||||
3. Add the project to `test/run-tests.sh`: add a new `test_downstream` line at the bottom, following the existing pattern:
|
3. Add the project to `test/run-tests.sh`: add a new `test_downstream` line at the bottom, following the existing pattern:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
test_downstream <owner> <repo> <makefile target>
|
test_downstream <owner> <repo> <makefile target> <build file> <sha1 hash of build file>
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
diff --git a/makefile b/makefile
|
diff --git a/makefile b/makefile
|
||||||
index 6513518..35826eb 100644
|
index 6513518..ba14638 100644
|
||||||
--- a/makefile
|
--- a/makefile
|
||||||
+++ b/makefile
|
+++ b/makefile
|
||||||
@@ -85,10 +85,10 @@ $(title).gb: $(objlisto)
|
@@ -85,10 +85,10 @@ $(title).gb: $(objlisto)
|
||||||
@@ -15,3 +15,12 @@ index 6513518..35826eb 100644
|
|||||||
|
|
||||||
# Files that will be included with incbin
|
# Files that will be included with incbin
|
||||||
|
|
||||||
|
@@ -108,7 +108,7 @@ obj/gb/sgb.o: \
|
||||||
|
|
||||||
|
# Local variable allocation
|
||||||
|
|
||||||
|
-obj/gb/localvars.z80: tools/savescan.py $(wildcard src/*.z80)
|
||||||
|
+obj/gb/localvars.z80: tools/savescan.py $(sort $(wildcard src/*.z80))
|
||||||
|
$(PY) $^ -o $@
|
||||||
|
|
||||||
|
# Graphics conversion
|
||||||
|
|||||||
@@ -1,8 +1,17 @@
|
|||||||
diff --git a/Makefile b/Makefile
|
diff --git a/Makefile b/Makefile
|
||||||
index 22c65e9..e7c888d 100644
|
index 22c65e9..fce4930 100644
|
||||||
--- a/Makefile
|
--- a/Makefile
|
||||||
+++ b/Makefile
|
+++ b/Makefile
|
||||||
@@ -51,7 +51,7 @@ ASMFILES := $(foreach dir,$(SOURCE_ALL_DIRS),$(wildcard $(dir)/*.asm))
|
@@ -44,14 +44,14 @@ BIN := $(NAME).$(EXT)
|
||||||
|
COMPAT_BIN := $(NAME)_compat.$(EXT)
|
||||||
|
|
||||||
|
# List of relative paths to all folders and subfolders with code or data.
|
||||||
|
-SOURCE_ALL_DIRS := $(shell find $(SOURCE) -type d -print)
|
||||||
|
+SOURCE_ALL_DIRS := $(sort $(shell find $(SOURCE) -type d -print))
|
||||||
|
|
||||||
|
# All files with extension asm are assembled.
|
||||||
|
-ASMFILES := $(foreach dir,$(SOURCE_ALL_DIRS),$(wildcard $(dir)/*.asm))
|
||||||
|
+ASMFILES := $(foreach dir,$(SOURCE_ALL_DIRS),$(sort $(wildcard $(dir)/*.asm)))
|
||||||
|
|
||||||
# List of include directories: All source and data folders.
|
# List of include directories: All source and data folders.
|
||||||
# A '/' is appended to the path.
|
# A '/' is appended to the path.
|
||||||
|
|||||||
@@ -54,21 +54,26 @@ done
|
|||||||
# When updating subprojects, change the commit being checked out, and set the `shallow-since`
|
# 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.
|
# to the day before, to reduce the amount of refs being transferred and thus speed up CI.
|
||||||
|
|
||||||
test_downstream() { # owner repo make-target
|
test_downstream() { # owner repo make-target build-file build-hash
|
||||||
if ! pushd "$2"; then
|
if ! pushd "$2"; then
|
||||||
echo >&2 'Please run `'"$FETCH_TEST_DEPS"'` before running the test suite'
|
echo >&2 'Please run `'"$FETCH_TEST_DEPS"'` before running the test suite'
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
make clean
|
make clean
|
||||||
make -j4 "$3" RGBDS=../../
|
make -j4 "$3" RGBDS=../../
|
||||||
|
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
|
popd
|
||||||
}
|
}
|
||||||
|
|
||||||
if "$nonfree"; then
|
if "$nonfree"; then
|
||||||
test_downstream pret pokecrystal compare
|
test_downstream pret pokecrystal compare pokecrystal.gbc f4cd194bdee0d04ca4eac29e09b8e4e9d818c133
|
||||||
test_downstream pret pokered compare
|
test_downstream pret pokered compare pokered.gbc ea9bcae617fdf159b045185467ae58b2e4a48b9a
|
||||||
test_downstream zladx LADX-Disassembly default
|
test_downstream zladx LADX-Disassembly default azle.gbc d90ac17e9bf17b6c61624ad9f05447bdb5efc01a
|
||||||
fi
|
fi
|
||||||
test_downstream AntonioND ucity all
|
test_downstream AntonioND ucity all ucity.gbc 67e67a4eaefb12ddc98d3caa8959102b885c0405
|
||||||
test_downstream pinobatch libbet all
|
test_downstream pinobatch libbet all libbet.gb 8bf954a61cd31fa665ad0abb7cea14561919a12c
|
||||||
test_downstream LIJI32 SameBoy bootroms
|
test_downstream LIJI32 SameBoy bootroms build/bin/BootROMs/cgb_boot.bin 113903775a9d34b798c2f8076672da6626815a91
|
||||||
|
|||||||
Reference in New Issue
Block a user