define PLC_MAIL_FROM_ADDRESS
[tests.git] / system / run_log
1 #!/bin/bash
2 cd $(dirname $0)
3 python3 -c "import time; print(int(time.time()))" > timestamp
4 mkdir -p logs
5 time=$(date +%H-%M)
6 runfile=run-${time}.txt
7 runlast=run
8 tracefile=trace-${time}.txt
9 tracelast=trace
10
11 # figure if TestMain succeeds, as the retcod gets lost in the pipe
12 rm -f logs/success
13 rm -f logs/$runlast; (cd logs; ln -s $runfile $runlast)
14 rm -f logs/$tracelast; (cd logs; ln -s $tracefile $tracelast)
15 python3 -u TestMain.py -t logs/$tracefile "$@" &> logs/$runfile ; retcod=$?
16 cat logs/$runfile
17 case "$retcod" in 
18     0) touch logs/success ;;
19     2) touch logs/warning ;;
20 esac
21
22 echo run_log exit_code $retcod
23 exit $retcod