summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Greenan <kmgreen2@gmail.com>2013-11-23 12:18:29 -0800
committerKevin Greenan <kmgreen2@gmail.com>2013-11-23 12:18:29 -0800
commite5170f70729e62803f63223403acfbd90a47370b (patch)
tree5975e313b6ff86637024efea09eb69fd8f070370
parent44201cf4366744c523080edf536a55d4cb4444eb (diff)
downloadjerasure-e5170f70729e62803f63223403acfbd90a47370b.tar.gz
Error handling fixed in test scripts...
-rwxr-xr-xExamples/test_all_gfs.sh14
-rwxr-xr-xExamples/time_all_gfs.sh12
2 files changed, 10 insertions, 16 deletions
diff --git a/Examples/test_all_gfs.sh b/Examples/test_all_gfs.sh
index 0605052..d3a4030 100755
--- a/Examples/test_all_gfs.sh
+++ b/Examples/test_all_gfs.sh
@@ -41,7 +41,6 @@ GF_COMPLETE_DIR=/usr/local/bin
GF_METHODS=${GF_COMPLETE_DIR}/gf_methods
k=12
m=3
-FAIL=
# Test all w=8
${GF_METHODS} | awk -F: '{ if ($1 == "w=8") print $2; }' |
@@ -50,12 +49,11 @@ while read method; do
./reed_sol_test_gf ${k} ${m} 8 ${method}
if [[ $? != "0" ]]; then
echo "Failed test for ${k} ${m} 8 ${method}"
- FAIL=1
exit 1
fi
done
-if [ -n ${FAIL} ]; then
+if [[ $? == "1" ]]; then
exit 1
fi
@@ -66,12 +64,12 @@ while read method; do
./reed_sol_test_gf ${k} ${m} 16 ${method}
if [[ $? != "0" ]]; then
echo "Failed test for ${k} ${m} 16 ${method}"
- FAIL=1
+ FAIL="1"
exit 1
fi
done
-if [ -n ${FAIL} ]; then
+if [[ $? == "1" ]]; then
exit 1
fi
@@ -82,13 +80,13 @@ while read method; do
./reed_sol_test_gf ${k} ${m} 32 ${method}
if [[ $? != "0" ]]; then
echo "Failed test for ${k} ${m} 32 ${method}"
- FAIL=1
+ FAIL="1"
exit 1
fi
done
-if [ -n ${FAIL} ]; then
+if [[ $? == "1" ]]; then
exit 1
fi
-echo "Passed all tests!" \ No newline at end of file
+echo "Passed all tests!"
diff --git a/Examples/time_all_gfs.sh b/Examples/time_all_gfs.sh
index e78d289..0c6a335 100755
--- a/Examples/time_all_gfs.sh
+++ b/Examples/time_all_gfs.sh
@@ -43,7 +43,6 @@ ITERATIONS=128
BUFSIZE=65536
k=12
m=3
-FAIL=
# Test all w=8
${GF_METHODS} | awk -F: '{ if ($1 == "w=8") print $2; }' |
@@ -52,12 +51,11 @@ while read method; do
./reed_sol_time_gf ${k} ${m} 8 ${ITERATIONS} ${BUFSIZE} ${method}
if [[ $? != "0" ]]; then
echo "Failed test for ${k} ${m} 8 ${ITERATIONS} ${BUFSIZE} ${method}"
- FAIL=1
exit 1
fi
done
-if [ -n ${FAIL} ]; then
+if [[ $? == "1" ]]; then
exit 1
fi
@@ -68,12 +66,11 @@ while read method; do
./reed_sol_time_gf ${k} ${m} 16 ${ITERATIONS} ${BUFSIZE} ${method}
if [[ $? != "0" ]]; then
echo "Failed test for ${k} ${m} 16 ${ITERATIONS} ${BUFSIZE} ${method}"
- FAIL=1
exit 1
fi
done
-if [ -n ${FAIL} ]; then
+if [[ $? == "1" ]]; then
exit 1
fi
@@ -84,13 +81,12 @@ while read method; do
./reed_sol_time_gf ${k} ${m} 32 ${ITERATIONS} ${BUFSIZE} ${method}
if [[ $? != "0" ]]; then
echo "Failed test for ${k} ${m} 32 ${ITERATIONS} ${BUFSIZE} ${method}"
- FAIL=1
exit 1
fi
done
-if [ -n ${FAIL} ]; then
+if [[ $? == "1" ]]; then
exit 1
fi
-echo "Passed all tests!" \ No newline at end of file
+echo "Passed all tests!"