From 3c73a980382bafb9c410831ff660aedff3a727dc Mon Sep 17 00:00:00 2001 From: Jim Monte Date: Sun, 8 Dec 2019 23:32:02 -0500 Subject: [PATCH] Modified regression tests for library processing to make indication of failures more robust --- tests/regression/lib-processing/ex1a.cir | 9 +++++---- tests/regression/lib-processing/ex1b.cir | 9 +++++---- tests/regression/lib-processing/ex2a.cir | 25 ++++++++++++++++++------ tests/regression/lib-processing/ex3a.cir | 25 ++++++++++++++++++------ 4 files changed, 48 insertions(+), 20 deletions(-) diff --git a/tests/regression/lib-processing/ex1a.cir b/tests/regression/lib-processing/ex1a.cir index 97ee70480..14375c877 100644 --- a/tests/regression/lib-processing/ex1a.cir +++ b/tests/regression/lib-processing/ex1a.cir @@ -17,12 +17,13 @@ op echo "Note: v(check0) = $&v(check0)" -if abs(v(check0)) > 1e-9 - quit 1 +if abs(v(check0)) <= 1e-9 + echo "INFO: ok" + quit 0 end -echo "INFO: ok" -quit 0 +echo ERROR: Test failure +quit 1 .endc diff --git a/tests/regression/lib-processing/ex1b.cir b/tests/regression/lib-processing/ex1b.cir index f92aa6b25..d37547d8d 100644 --- a/tests/regression/lib-processing/ex1b.cir +++ b/tests/regression/lib-processing/ex1b.cir @@ -21,12 +21,13 @@ op echo "Note: v(check0) = $&v(check0)" -if abs(v(check0)) > 1e-9 - quit 1 +if abs(v(check0)) <= 1e-9 + echo "INFO: ok" + quit 0 end -echo "INFO: ok" -quit 0 +echo ERROR: Test failure +quit 1 .endc diff --git a/tests/regression/lib-processing/ex2a.cir b/tests/regression/lib-processing/ex2a.cir index 32aadb77a..497b50b8f 100644 --- a/tests/regression/lib-processing/ex2a.cir +++ b/tests/regression/lib-processing/ex2a.cir @@ -15,19 +15,32 @@ Vcheck2 9 check2 2.0V .control op +let n_pass = 0 + echo "Note: v(check1) = $&v(check1)" echo "Note: v(check2) = $&v(check2)" -if abs(v(check1)) > 1e-9 - quit 1 +if abs(v(check1)) <= 1e-9 + let n_pass = n_pass + 1 +else + echo "ERROR: Test 1 failed" end -if abs(v(check2)) > 1e-9 - quit 1 + +if abs(v(check2)) <= 1e-9 + let n_pass = n_pass + 1 +else + echo "ERROR: Test 2 failed" end -echo "INFO: ok" -quit 0 + +if n_pass = 2 + echo "INFO: ok" + quit 0 +end + +echo ERROR: $&n_pass of 2 tests passed +quit 1 .endc diff --git a/tests/regression/lib-processing/ex3a.cir b/tests/regression/lib-processing/ex3a.cir index 844ea2ea8..16578da72 100644 --- a/tests/regression/lib-processing/ex3a.cir +++ b/tests/regression/lib-processing/ex3a.cir @@ -15,19 +15,32 @@ Vcheck2 9 check2 2.0V .control op +let n_pass = 0 + echo "Note: v(check1) = $&v(check1)" echo "Note: v(check2) = $&v(check2)" -if abs(v(check1)) > 1e-9 - quit 1 +if abs(v(check1)) <= 1e-9 + let n_pass = n_pass + 1 +else + echo "ERROR: Test 1 failed" end -if abs(v(check2)) > 1e-9 - quit 1 + +if abs(v(check2)) <= 1e-9 + let n_pass = n_pass + 1 +else + echo "ERROR: Test 2 failed" end -echo "INFO: ok" -quit 0 + +if n_pass = 2 + echo "INFO: ok" + quit 0 +end + +echo ERROR: $&n_pass of 2 tests passed +quit 1 .endc