From cdd2117ef001dd80cdc5fa2204b794b544c7f70f Mon Sep 17 00:00:00 2001 From: Jason Nochlin Date: Thu, 11 Jan 2024 22:46:56 -0700 Subject: [PATCH] move prepare_$fork.sh invocation to right below hyperfine since test.sh also invokes it --- evaluate2.sh | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/evaluate2.sh b/evaluate2.sh index 725e2fb03a..c3a1801247 100755 --- a/evaluate2.sh +++ b/evaluate2.sh @@ -137,16 +137,7 @@ fi filetimestamp=$(date +"%Y%m%d%H%M%S") # same for all fork.out files from this run failed=() for fork in "$@"; do - set -e - - # Use prepare script to invoke SDKMAN - if [ -f "./prepare_$fork.sh" ]; then - print_and_execute source "./prepare_$fork.sh" - else - print_and_execute sdk use java $DEFAULT_JAVA_VERSION - fi - - set +e # we don't want test.sh or hyperfine failing on 1 fork to exit the script early + set +e # we don't want prepare.sh, test.sh or hyperfine failing on 1 fork to exit the script early # Run the test suite print_and_execute $TIMEOUT ./test.sh --quiet $fork @@ -174,6 +165,13 @@ for fork in "$@"; do print_and_execute rm -f measurements.txt print_and_execute ln -s $MEASUREMENTS_FILE measurements.txt + # Run prepare script + if [ -f "./prepare_$fork.sh" ]; then + print_and_execute source "./prepare_$fork.sh" + else + print_and_execute sdk use java $DEFAULT_JAVA_VERSION + fi + # Use hyperfine to run the benchmark for each fork HYPERFINE_OPTS="--warmup 0 --runs $RUNS --export-json $fork-$filetimestamp-timing.json --output ./$fork-$filetimestamp.out" @@ -195,6 +193,7 @@ for fork in "$@"; do continue fi done +set -e # Summary echo -e "${BOLD_WHITE}Summary${RESET}"