modified test to quit when fails so doesn't output test passed! message
[strong_simulation_gauss_sum_rank.git] / test.bash
index 91cb69ec6e8b189434e2df6a59b8d7a38edee95d..f8aeca1e265ab375e62127f028c54b4e79c11f50 100644 (file)
--- a/test.bash
+++ b/test.bash
@@ -12,6 +12,9 @@ numTgates=4
 
 numPaulis=1 # we want numPaulis to be 1 for the loop below
 
 
 numPaulis=1 # we want numPaulis to be 1 for the loop below
 
+numruns=20
+
+echo "Starting test of $numruns random Pauli expectation values..."
 for i in $(seq 1 $numruns)
 do
   sleep 1;a=$(stdbuf -oL ./randommultipleinputPaulis $numqubits $numTgates $numPaulis > inputPaulis.txt && $gausssumcode < inputPaulis.txt | tail -1)
 for i in $(seq 1 $numruns)
 do
   sleep 1;a=$(stdbuf -oL ./randommultipleinputPaulis $numqubits $numTgates $numPaulis > inputPaulis.txt && $gausssumcode < inputPaulis.txt | tail -1)
@@ -22,6 +25,7 @@ do
     continue
   else
     echo "NOT EQUAL!"
     continue
   else
     echo "NOT EQUAL!"
-    break
+    exit
   fi
 done
   fi
 done
+echo "Test passed!"