| #!/bin/sh |
| |
| ## wrapper to run other other tests |
| |
| program=$1 |
| program_dir=$(dirname $0) |
| |
| # Prefer to OOM kill job runner first. |
| # This prevents some server/client test cases from blocking on OOM. |
| echo 1000 > /proc/$PPID/oom_score_adj |
| |
| echo $$ >> $TMP/pid-tests |
| |
| shift |
| |
| fifo=$TMP/fifo-$program |
| [ -p "$fifo" ] || mkfifo $fifo |
| tee -a $TMP_RESULT_ROOT/$program < $fifo & |
| echo $! >> $TMP/.pid-pipes |
| |
| # in particular, avoid time in trinity |
| [ -n "$category" ] && { |
| time_path=$(which time) |
| if [ "x${time_path}" != "x" ];then |
| time_help=$(${time_path} --help) |
| [ "${time_help#*--output}" != "${time_help}" ] && |
| time_prefix="${time_path} -v -o $TMP/${program}.time" |
| fi |
| } |
| |
| exec $time_prefix $exec_prefix $program_dir/$program "$@" > $fifo |