Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Unified Diff: sim/testsuite/sim/bfin/run-tests.sh

Issue 124383005: GDB 7.6.50 (Closed) Base URL: http://git.chromium.org/native_client/nacl-gdb.git@upstream
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sim/testsuite/sim/bfin/ChangeLog ('k') | sim/testsuite/sim/bfin/se_all32bitopcodes.S » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sim/testsuite/sim/bfin/run-tests.sh
diff --git a/sim/testsuite/sim/bfin/run-tests.sh b/sim/testsuite/sim/bfin/run-tests.sh
old mode 100644
new mode 100755
index 2b6181b5fb3437b5a6653e6c34313962f086cd3a..c5ee7771f319f77c981773103ecdee6bb1bbde2f
--- a/sim/testsuite/sim/bfin/run-tests.sh
+++ b/sim/testsuite/sim/bfin/run-tests.sh
@@ -10,8 +10,9 @@ usage() {
-rs Run on simulator
-rj <board> Run on board via JTAG
-rh <ip> Run on board ip
+ -j <num> Num jobs to run
EOF
- exit ${0:-1}
+ exit ${1:-1}
}
: ${MAKE:=make}
@@ -20,11 +21,14 @@ boardjtag=
run_sim=false
run_jtag=false
run_host=false
+jobs=`getconf _NPROCESSORS_ONLN 2>/dev/null || echo 1`
+: $(( jobs += 1 ))
while [ -n "$1" ] ; do
case $1 in
-rs) run_sim=true;;
-rj) boardjtag=$2; shift; run_jtag=true;;
-rh) boardip=$2; shift; run_host=true;;
+ -j) jobs=$2; shift;;
-*) usage;;
*) break;;
esac
@@ -36,6 +40,8 @@ if ${run_host} && [ -z "${boardip}" ] ; then
usage
fi
+cd "${0%/*}" || exit 1
+
dorsh() {
# rsh sucks and does not pass up its exit status, so we have to:
# on board:
@@ -85,7 +91,6 @@ dojtag() {
}
testit() {
-
local name=$1 x=$2 y=`echo $2 | sed 's:\.[xX]$::'` out rsh_out addr
shift; shift
local fail=`grep xfail ${y}`
@@ -145,8 +150,7 @@ pf() {
[ $# -eq 0 ] && set -- *.[Ss]
bins_hw=$( (${run_sim} || ${run_jtag}) && printf '%s.x ' "$@")
if ${run_host} ; then
- for files in $@
- do
+ for files in "$@" ; do
tmp=`grep -e CYCLES -e TESTSET -e CLI -e STI -e RTX -e RTI -e SEQSTAT $files -l`
if [ -z "${tmp}" ] ; then
bins_host=`echo "${bins_host} ${files}.X"`
@@ -194,20 +198,41 @@ if ${run_host} ; then
rsh -l root $boardip '/bin/dmesg -c' > /dev/null
fi
+SIM="../../../bfin/run"
+if [ ! -x ${SIM} ] ; then
+ SIM="bfin-elf-run"
+fi
+echo "Using sim: ${SIM}"
+
ret=0
unexpected_fail=0
unexpected_pass=0
expected_pass=0
+pids=()
for s in "$@" ; do
- ${run_sim} && testit SIM ${s}.x bfin-elf-run `sed -n '/^# sim:/s|^[^:]*:||p' ${s}`
+ (
+ out=$(
+ ${run_sim} && testit SIM ${s}.x ${SIM} `sed -n '/^# sim:/s|^[^:]*:||p' ${s}`
${run_jtag} && testit JTAG ${s}.x dojtag
${run_host} && testit HOST ${s}.X dorsh
+ )
+ case $out in
+ *PASS*) ;;
+ *) echo "$out" ;;
+ esac
+ ) &
+ pids+=( $! )
+ if [[ ${#pids[@]} -gt ${jobs} ]] ; then
+ wait ${pids[0]}
+ pids=( ${pids[@]:1} )
+ fi
done
+wait
killall -q bfin-gdbproxy
if [ ${ret} -eq 0 ] ; then
rm -f gdbproxy.log
- ${MAKE} -s clean &
+# ${MAKE} -s clean &
exit 0
else
echo number of failures ${ret}
@@ -222,4 +247,3 @@ else
fi
exit 1
fi
-
« no previous file with comments | « sim/testsuite/sim/bfin/ChangeLog ('k') | sim/testsuite/sim/bfin/se_all32bitopcodes.S » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698