Commit e5170f70729e62803f63223403acfbd90a47370b

Authored by KMG
1 parent 44201cf4
Exists in master and in 1 other branch v2

Error handling fixed in test scripts...

Examples/test_all_gfs.sh
... ... @@ -41,7 +41,6 @@ GF_COMPLETE_DIR=/usr/local/bin
41 41 GF_METHODS=${GF_COMPLETE_DIR}/gf_methods
42 42 k=12
43 43 m=3
44   -FAIL=
45 44  
46 45 # Test all w=8
47 46 ${GF_METHODS} | awk -F: '{ if ($1 == "w=8") print $2; }' |
... ... @@ -50,12 +49,11 @@ while read method; do
50 49 ./reed_sol_test_gf ${k} ${m} 8 ${method}
51 50 if [[ $? != "0" ]]; then
52 51 echo "Failed test for ${k} ${m} 8 ${method}"
53   - FAIL=1
54 52 exit 1
55 53 fi
56 54 done
57 55  
58   -if [ -n ${FAIL} ]; then
  56 +if [[ $? == "1" ]]; then
59 57 exit 1
60 58 fi
61 59  
... ... @@ -66,12 +64,12 @@ while read method; do
66 64 ./reed_sol_test_gf ${k} ${m} 16 ${method}
67 65 if [[ $? != "0" ]]; then
68 66 echo "Failed test for ${k} ${m} 16 ${method}"
69   - FAIL=1
  67 + FAIL="1"
70 68 exit 1
71 69 fi
72 70 done
73 71  
74   -if [ -n ${FAIL} ]; then
  72 +if [[ $? == "1" ]]; then
75 73 exit 1
76 74 fi
77 75  
... ... @@ -82,13 +80,13 @@ while read method; do
82 80 ./reed_sol_test_gf ${k} ${m} 32 ${method}
83 81 if [[ $? != "0" ]]; then
84 82 echo "Failed test for ${k} ${m} 32 ${method}"
85   - FAIL=1
  83 + FAIL="1"
86 84 exit 1
87 85 fi
88 86 done
89 87  
90   -if [ -n ${FAIL} ]; then
  88 +if [[ $? == "1" ]]; then
91 89 exit 1
92 90 fi
93 91  
94   -echo "Passed all tests!"
95 92 \ No newline at end of file
  93 +echo "Passed all tests!"
... ...
Examples/time_all_gfs.sh
... ... @@ -43,7 +43,6 @@ ITERATIONS=128
43 43 BUFSIZE=65536
44 44 k=12
45 45 m=3
46   -FAIL=
47 46  
48 47 # Test all w=8
49 48 ${GF_METHODS} | awk -F: '{ if ($1 == "w=8") print $2; }' |
... ... @@ -52,12 +51,11 @@ while read method; do
52 51 ./reed_sol_time_gf ${k} ${m} 8 ${ITERATIONS} ${BUFSIZE} ${method}
53 52 if [[ $? != "0" ]]; then
54 53 echo "Failed test for ${k} ${m} 8 ${ITERATIONS} ${BUFSIZE} ${method}"
55   - FAIL=1
56 54 exit 1
57 55 fi
58 56 done
59 57  
60   -if [ -n ${FAIL} ]; then
  58 +if [[ $? == "1" ]]; then
61 59 exit 1
62 60 fi
63 61  
... ... @@ -68,12 +66,11 @@ while read method; do
68 66 ./reed_sol_time_gf ${k} ${m} 16 ${ITERATIONS} ${BUFSIZE} ${method}
69 67 if [[ $? != "0" ]]; then
70 68 echo "Failed test for ${k} ${m} 16 ${ITERATIONS} ${BUFSIZE} ${method}"
71   - FAIL=1
72 69 exit 1
73 70 fi
74 71 done
75 72  
76   -if [ -n ${FAIL} ]; then
  73 +if [[ $? == "1" ]]; then
77 74 exit 1
78 75 fi
79 76  
... ... @@ -84,13 +81,12 @@ while read method; do
84 81 ./reed_sol_time_gf ${k} ${m} 32 ${ITERATIONS} ${BUFSIZE} ${method}
85 82 if [[ $? != "0" ]]; then
86 83 echo "Failed test for ${k} ${m} 32 ${ITERATIONS} ${BUFSIZE} ${method}"
87   - FAIL=1
88 84 exit 1
89 85 fi
90 86 done
91 87  
92   -if [ -n ${FAIL} ]; then
  88 +if [[ $? == "1" ]]; then
93 89 exit 1
94 90 fi
95 91  
96   -echo "Passed all tests!"
97 92 \ No newline at end of file
  93 +echo "Passed all tests!"
... ...