diff options
author | svn_bwardell <svn_bwardell@105869f7-3296-0410-a4ea-f4349344b45a> | 2011-08-07 12:43:08 +0000 |
---|---|---|
committer | svn_bwardell <svn_bwardell@105869f7-3296-0410-a4ea-f4349344b45a> | 2011-08-07 12:43:08 +0000 |
commit | f02ccb2663070e74d780bb2e01b0df502bdad8b5 (patch) | |
tree | d5fe708c4021a7cf1d3529b71bc10ff5198341b6 /src | |
parent | 921173d2d46e1a69b681ec8aab0fbe5429da760a (diff) |
Unconditionally run tests and abort if any fail.
git-svn-id: https://svn.cct.lsu.edu/repos/numrel/LSUThorns/Vectors/trunk@23 105869f7-3296-0410-a4ea-f4349344b45a
Diffstat (limited to 'src')
-rw-r--r-- | src/test.c | 15 |
1 files changed, 7 insertions, 8 deletions
@@ -13,7 +13,7 @@ if(vecres == res) \ passed++; \ else \ - CCTK_VWarn(warnlevel, __LINE__, __FILE__, \ + CCTK_VWarn(CCTK_WARN_ALERT, __LINE__, __FILE__, \ CCTK_THORNSTRING, "Failed test %s", testname); \ numtests++; \ } \ @@ -24,12 +24,6 @@ void Vectors_Test(CCTK_ARGUMENTS) DECLARE_CCTK_ARGUMENTS; DECLARE_CCTK_PARAMETERS; - int warnlevel; - if (CCTK_EQUALS(tests, "abort")) - warnlevel = CCTK_WARN_ABORT; - else - warnlevel = CCTK_WARN_ALERT; - CCTK_INT passed = 0, numtests=0; CCTK_REAL a[CCTK_REAL_VEC_SIZE]; @@ -79,6 +73,11 @@ void Vectors_Test(CCTK_ARGUMENTS) VECTEST("kifthen 0", kifthen(ToReal(0.),bv,cv), signbit(0.)?c[i]:b[i]); VECTEST("kifthen -0", kifthen(ToReal(-0.),bv,cv), signbit(-0.)?c[i]:b[i]); - CCTK_VInfo(CCTK_THORNSTRING, "%d/%d tests passed ", passed, numtests); + if (passed != numtests) + CCTK_VWarn(CCTK_WARN_ABORT, __LINE__, __FILE__, CCTK_THORNSTRING, + "Failed %d correctness tests", numtests - passed); + else + CCTK_VInfo(CCTK_THORNSTRING, "%d/%d tests passed ", passed, numtests); + return; } |