From 96a085686bdfe8bb98ddb4827671b82879c189d9 Mon Sep 17 00:00:00 2001 From: pantonshire Date: Thu, 8 Sep 2022 16:55:30 +0100 Subject: [PATCH] test: improve test script to allow easily adding new runs test.sh previously had each of its runs hard-coded; this patch changes the script to loop over an array of cargo flags instead. This allows new flags to be added to the array to easily add new runs to the test script. --- test.sh | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/test.sh b/test.sh index 3158430..945ced3 100755 --- a/test.sh +++ b/test.sh @@ -2,17 +2,15 @@ set -e set -o pipefail -# no_std and no alloc -cargo +nightly miri test --no-default-features --features serde +TEST_RUNS=( + '--no-default-features --features serde' + '--no-default-features --features alloc,serde' + '--features serde' + '--target sparc-unknown-linux-gnu --features serde' + '--target mips64-unknown-linux-gnuabi64 --features serde' +) -# no_std with alloc -cargo +nightly miri test --no-default-features --features alloc,serde - -# std -cargo +nightly miri test --features serde - -# 32-bit target -cargo +nightly miri test --target sparc-unknown-linux-gnu --features serde - -# Big-endian target -cargo +nightly miri test --target mips64-unknown-linux-gnuabi64 --features serde +for FLAGS in "${TEST_RUNS[@]}" +do + cargo +nightly miri test $FLAGS +done