From 68d3ef8e76dca8c545ca2084e6d17e11987dcec7 Mon Sep 17 00:00:00 2001 From: ISSOtm Date: Thu, 19 May 2022 22:45:02 +0200 Subject: [PATCH] Only test a few random padding values each time It's unlikely that a specific value matters, though in theory possible; however, an exhaustive test every time is really slow, and testing a couple random values should, over time, cover everything. It is fine to test random values because those tested will be logged, so the problem can be manually reproduced later. It does make CI technically not deterministic... but that should be fine. --- test/fix/test.sh | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/test/fix/test.sh b/test/fix/test.sh index 9a8da723..bd30524f 100755 --- a/test/fix/test.sh +++ b/test/fix/test.sh @@ -80,22 +80,23 @@ echo "${bold}Checking padding...${resbold}" cp "$src"/padding{,-large,-larger}.bin . touch padding{,-large,-larger}.err progress=0 -for b in {0..254}; do - printf "\r$b..." +for (( i=0; i < 10; ++i )); do + (( padding = RANDOM % 256 )) + echo "$padding..." for suffix in '' -large -larger; do - cat <<<'-p $b' >padding$suffix.flags - tr '\377' \\$(($b / 64))$((($b / 8) % 8))$(($b % 8)) <"$src/padding$suffix.gb" >padding$suffix.gb # OK because $FF bytes are only used for padding + cat <<<"-p $padding" >padding$suffix.flags + tr '\377' \\$((padding / 64))$(((padding / 8) % 8))$((padding % 8)) <"$src/padding$suffix.gb" >padding$suffix.gb # OK because $FF bytes are only used for padding runTest padding${suffix} . done done -printf "\rDone! \n" +echo "Done!" # TODO: check MBC names # Check that RGBFIX errors out when inputting a non-existent file... $RGBFIX noexist 2>out.err -rc=$(($rc || $? != 1)) +rc=$((rc || $? != 1)) tryDiff "$src/noexist.err" out.err noexist.err -rc=$(($rc || $?)) +rc=$((rc || $?)) exit $rc