OLD | NEW |
1 #!/bin/bash | 1 #!/bin/bash |
2 | 2 |
3 echo "Running all tests in `pwd`" | 3 echo "Running all tests in `pwd`" |
4 | 4 |
5 SEL_LDR="SEL_LDR NOT FOUND" | 5 SEL_LDR="SEL_LDR NOT FOUND" |
6 | 6 |
7 if [ ! -n "$1" ] | 7 if [ ! -n "$1" ] |
8 then | 8 then |
9 echo "sel_ldr not provided as argument, attempting to locate it." | 9 echo "sel_ldr not provided as argument, attempting to locate it." |
10 #check for sel_ldr in path | 10 #check for sel_ldr in path |
11 SEL_LDR=`which sel_ldr` | 11 SEL_LDR=`which sel_ldr` |
12 | 12 |
13 if [ "x${SEL_LDR}" == "x" ] | 13 if [ "x${SEL_LDR}" = "x" ] |
14 then | 14 then |
15 echo "sel_ldr binary not found in path."; | 15 echo "sel_ldr binary not found in path."; |
16 echo "Please enter complete path to sel_ldr:" | 16 echo "Please enter complete path to sel_ldr:" |
17 read SEL_LDR | 17 read SEL_LDR |
18 fi | 18 fi |
19 else | 19 else |
20 echo "found arg" | 20 echo "found arg" |
21 SEL_LDR=$1; | 21 SEL_LDR=$1; |
22 fi | 22 fi |
23 | 23 |
24 MATCH=`expr match "$SEL_LDR" '.*sel_ldr'` | 24 MATCH=`expr match "$SEL_LDR" '.*sel_ldr'` |
25 | 25 |
26 if [ "$MATCH" -ne "0" ] | 26 if [ "$MATCH" -ne "0" ] |
27 then | 27 then |
28 echo "using sel_ldr: ${SEL_LDR}" | 28 echo "using sel_ldr: ${SEL_LDR}" |
29 | 29 |
30 for i in `ls *test*\.nexe`; | 30 for i in `ls *test*\.nexe`; |
31 do | 31 do |
32 echo "Running: "$i; | 32 echo "Running: "$i; |
33 $SEL_LDR $i || exit 1 | 33 $SEL_LDR $i || exit 1 |
34 echo "Test finished successfully, moving on..." | 34 echo "Test finished successfully, moving on..." |
35 done | 35 done |
36 echo "All tests appear to have finished without major problems." | 36 echo "All tests appear to have finished without major problems." |
37 else | 37 else |
38 echo "Could not find sel_ldr via argument, PATH or user input." | 38 echo "Could not find sel_ldr via argument, PATH or user input." |
39 echo "Recommended Usage: runtests.sh PATH_TO_SEL_LDR" | 39 echo "Recommended Usage: runtests.sh PATH_TO_SEL_LDR" |
40 fi | 40 fi |
OLD | NEW |