X-Git-Url: http://rtime.felk.cvut.cz/gitweb/can-benchmark.git/blobdiff_plain/ef13bcae14794256b4b632f8e7c440a7e93ba62a:/tests/lib.sh..0b85f7d8d9aa48ec67f0559dfe42ce370399a7f0:/tests/_lib.sh diff --git a/tests/lib.sh b/tests/_lib.sh similarity index 77% rename from tests/lib.sh rename to tests/_lib.sh index 984af0a..5eb70fd 100644 --- a/tests/lib.sh +++ b/tests/_lib.sh @@ -2,6 +2,7 @@ while [ $# -gt 0 ]; do case "$1" in -p) OPT_PLOT_ONLY=1; shift;; + --pdf-only) OPT_PDF_ONLY=1; shift;; esac done @@ -59,9 +60,7 @@ prepare_socketcan_virtual() { } run_tests() { - [ "$OPT_PLOT_ONLY" -eq 1 ] && return - - tests=${TESTS:-lincan_hw socketcan_hw} + tests=${TESTS:-socketcan_hw lincan_hw} for i in $tests; do prepare_$i t @@ -71,9 +70,21 @@ run_tests() { plot() { if [ -n "$PLOT_CMD" ]; then echo "set terminal postscript color eps enhanced; - set output '`basename $0 .sh`.eps'; $PLOT_CMD" | gnuplot - echo "set terminal x11 enhanced; $PLOT_CMD" | gnuplot -persist + $PLOT_CMD" | gnuplot | epstopdf --filter > `basename $0 .sh`.pdf + if [ -z "$OPT_PDF_ONLY" ]; then + echo "set terminal x11 enhanced; $PLOT_CMD" | gnuplot -persist + fi fi } -trap 'run_tests && plot' EXIT +go() { + d=results/`basename $0 .sh`/`uname -r` + mkdir -p $d + cd $d + + [ -n "$OPT_PLOT_ONLY" ] || run_tests + plot + +} + +trap 'go' EXIT