#!/bin/bash cd $(dirname $0) python3 -c "import time; print(int(time.time()))" > timestamp mkdir -p logs time=$(date +%H-%M) runfile=run-${time}.txt runlast=run tracefile=trace-${time}.txt tracelast=trace # figure if TestMain succeeds, as the retcod gets lost in the pipe rm -f logs/success rm -f logs/$runlast; (cd logs; ln -s $runfile $runlast) rm -f logs/$tracelast; (cd logs; ln -s $tracefile $tracelast) python3 -u TestMain.py -t logs/$tracefile "$@" &> logs/$runfile ; retcod=$? cat logs/$runfile case "$retcod" in 0) touch logs/success ;; 2) touch logs/warning ;; esac echo run_log exit_code $retcod exit $retcod