From 8124a0ca0822834f413e1f7f664b8d5899aadb3e Mon Sep 17 00:00:00 2001 From: Alexander Yastrebov Date: Thu, 4 Jan 2024 20:36:20 +0100 Subject: test: add script to test all implementations The script tests all implementations and prints PASS or FAIL status. In case of failure it also prints implementation output to stderr. This will be handy for adding new test samples. Show test statuses and omit failing output: ```sh $ ./test_all.sh 2>/dev/null PASS artsiomkorzun PASS baseline PASS bjhara PASS criccomini FAIL ddimtirov FAIL ebarlas PASS filiphr FAIL itaske PASS khmarbaise FAIL kuduwa-keshavram FAIL lawrey PASS padreati FAIL palmr PASS richardstartin FAIL royvanrijn FAIL seijikun PASS spullara PASS truelive ``` Show only passing implementations: ``` $ ./test_all.sh 2>/dev/null | grep PASS | cut -d' ' -f2 artsiomkorzun baseline bjhara criccomini filiphr khmarbaise padreati richardstartin spullara truelive ``` For #61 --- test.sh | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'test.sh') diff --git a/test.sh b/test.sh index 16308ba..4bec036 100755 --- a/test.sh +++ b/test.sh @@ -15,19 +15,16 @@ # limitations under the License. # -if [ -z "$1" ] - then - echo "Usage: test.sh " - exit 1 -fi - -java --version +set -euo pipefail -mvn clean verify +if [ -z "$1" ]; then + echo "Usage: test.sh " + exit 1 +fi -for sample in $(ls src/test/resources/samples/*.txt) -do +for sample in $(ls src/test/resources/samples/*.txt); do echo "Validating calculate_average_$1.sh -- $sample" + rm -f measurements.txt ln -s $sample measurements.txt -- cgit v1.2.3