summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/expat/expat/run-ptest
blob: 1b39cec8e5eea7a2a6e4f16713ee5c9157cd1f4b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash

output=${1:-"expat_tests.log"} # default log file

# logging function
function testCheck() {
	testExec="$1"
	shift
	echo && echo ${testExec} && ./${testExec} "$@"
	error=$?
	result=$([[ ${error} -eq 0 ]] && echo "PASS" || echo "FAIL")
	echo "${result}: ${testExec}" && echo "============================"
}

export output
export -f testCheck
TIME=$(which time)

echo "Architecture: $(uname -m)" > ${output}
echo "Image: $(uname -sr)" >> ${output}
${TIME} -f 'Execution time: %e s' bash -c "testCheck runtests -vv" |& tee -a ${output}
${TIME} -f 'Execution time: %e s' bash -c "testCheck runtestspp -vv" |& tee -a ${output}
echo