X-Git-Url: http://plrg.eecs.uci.edu/git/?p=model-checker-benchmarks.git;a=blobdiff_plain;f=bench.sh;h=7c9eec856f0b3158cc5997422ba9c7d56479aa98;hp=03409356aa37f07c72a046c8b7972328d20e8009;hb=HEAD;hpb=6ad55b673cd0430f7c525f0d19e4fff5b94c971e diff --git a/bench.sh b/bench.sh index 0340935..7c9eec8 100755 --- a/bench.sh +++ b/bench.sh @@ -1,30 +1,20 @@ #!/bin/bash # A (work-in-progress) test script for running our benchmarks -# Runs all tests, logging output to a directory named -# '${BASEDIR}/run-', where ${BASEDIR} is either the current -# directory or the first parameter to this script - -## Unfinished benchmarks - do not use -# queue williams-queue +# Runs all tests, with timing information DATECMD="date +%Y-%m-%d-%R" DATE="`${DATECMD}`" -BASEDIR=. - -[ $# -gt 0 ] && [ -d "$1" ] && BASEDIR="$1" && shift - -DIR="${BASEDIR}/run-${DATE}" TESTS="chase-lev-deque/main" TESTS+=" spsc-queue/spsc-queue" TESTS+=" spsc-bugfix/spsc-queue" TESTS+=" barrier/barrier" +TESTS+=" dekker-fences/dekker-fences" TESTS+=" mcs-lock/mcs-lock" TESTS+=" mpmc-queue/mpmc-queue-rdwr" TESTS+=" ms-queue/main" TESTS+=" linuxrwlocks/linuxrwlocks" -TESTS+=" dekker-fences/dekker-fences" MODEL_ARGS="-y -m 2 -u 3" @@ -40,14 +30,13 @@ function run_test { shift ARGS="$@" RUN="./run.sh" - LOG=${DIR}/log-${COUNT} echo "-----------------------------------------------" echo "*******************************" - echo "Running test ${COUNT} (${t}): logging to ${LOG}" + echo "Running test ${COUNT} (${t})" echo "ARGS=${ARGS}" echo "*******************************" - (time ${RUN} ${t} ${ARGS} 2>&1) 2>&1 | tee ${LOG} + (time ${RUN} ${t} ${ARGS} 2>&1) 2>&1 echo echo "Test done; sleeping for a few seconds" echo @@ -67,5 +56,16 @@ function run_all_tests { #run_test mpmc-queue/mpmc-queue ${MODEL_ARGS} -- -r 2 -w 2 } -mkdir ${DIR} -(cd ..; git log --oneline -1; cd - > /dev/null; git log --oneline -1; echo; run_all_tests) | tee ${DIR}/timing.log +# Check if git is available, and this is a git repository +GIT=0 +which git &> /dev/null && git rev-parse &> /dev/null && GIT=1 + +# Print out some git information, if available +if [ ${GIT} -ne 0 ]; then + cd .. + git log --oneline -1 + cd - > /dev/null + git log --oneline -1 + echo +fi +run_all_tests