You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@milagro.apache.org by sa...@apache.org on 2016/11/25 10:45:05 UTC

[6/7] incubator-milagro-crypto git commit: fixed typo in run_test.sh

fixed typo in run_test.sh


Project: http://git-wip-us.apache.org/repos/asf/incubator-milagro-crypto/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-milagro-crypto/commit/36de7c07
Tree: http://git-wip-us.apache.org/repos/asf/incubator-milagro-crypto/tree/36de7c07
Diff: http://git-wip-us.apache.org/repos/asf/incubator-milagro-crypto/diff/36de7c07

Branch: refs/heads/master
Commit: 36de7c07a34a780c6cdf3a46f4f8435abdaeb498
Parents: cd3086f
Author: Kealan McCusker <ke...@certivox.com>
Authored: Thu Nov 24 19:51:05 2016 +0000
Committer: Kealan McCusker <ke...@certivox.com>
Committed: Thu Nov 24 19:51:05 2016 +0000

----------------------------------------------------------------------
 js/tests/run_test.sh | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-milagro-crypto/blob/36de7c07/js/tests/run_test.sh
----------------------------------------------------------------------
diff --git a/js/tests/run_test.sh b/js/tests/run_test.sh
index 5e6c2e8..c6415f1 100755
--- a/js/tests/run_test.sh
+++ b/js/tests/run_test.sh
@@ -4,10 +4,14 @@
 # This script runs tests that compares the js
 # with the expected output from the c code
 #
-# usage: ./run_js_tests.sh
+# usage: ./run_test.sh
 
 output_file="log.txt"
-rm $output_file
+if [[ -f "$output_file" ]]
+then
+  echo "rm $output_file"
+  rm $output_file
+fi
 
 ln -s BNCX.json testVectors.json
 ln -s BNCXOnePass.json testVectorsOnePass.json
@@ -45,6 +49,12 @@ echo "TEST 7: node test_onepass.js"
 echo "TEST 7: node test_onepass.js" >> $output_file 
 node test_onepass.js >> $output_file 2>&1
 
+error=$(grep -i error "${output_file}" )
+if [[ -n "$error" ]]; then
+   echo "ERROR. Please review ${output_file}"
+   exit 1
+fi
+
 failed=$(grep FAILED "${output_file}" )
 if [[ -n "$failed" ]]; then
    echo "A TEST HAS FAILED. Please review ${output_file}"
@@ -54,10 +64,5 @@ else
    echo "ALL TESTS PASSED" >> $output_file 
 fi
 
-error=$(grep -i error "${output_file}" )
-if [[ -n "$error" ]]; then
-   echo "ERROR. Please review ${output_file}"
-fi
-
 rm testVectors.json
 rm testVectorsOnePass.json