From c93da26c550147a572395d6d349227b9b386e362 Mon Sep 17 00:00:00 2001 From: schnetter Date: Fri, 2 Mar 2007 03:45:17 +0000 Subject: Add a grid scalar to indicate success or failure of the self tests. Add a test cases running the self test and using this variable as indicator. git-svn-id: http://svn.cactuscode.org/arrangements/CactusNumerical/SlabTest/trunk@10 732e31d2-b375-409b-9bd3-699c3b2c9da5 --- interface.ccl | 4 ++++ schedule.ccl | 2 ++ src/slabtest.c | 6 +++++- test/slabtest.par | 22 ++++++++++++++++++++++ test/slabtest/success.xg | 2 ++ 5 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 test/slabtest.par create mode 100644 test/slabtest/success.xg diff --git a/interface.ccl b/interface.ccl index ac13f1e..4660510 100644 --- a/interface.ccl +++ b/interface.ccl @@ -28,3 +28,7 @@ CCTK_REAL a3s TYPE=array DIM=3 SIZE=10,10,10 { a3x a3y a3z } "3D grid arrays" + + + +CCTK_INT success "Indicate a successful test" diff --git a/schedule.ccl b/schedule.ccl index 03253a7..7b92a2e 100644 --- a/schedule.ccl +++ b/schedule.ccl @@ -1,6 +1,8 @@ # Schedule definitions for thorn SlabTest # $Header$ +STORAGE: success + SCHEDULE SlabTest_Test AT initial { LANG: C diff --git a/src/slabtest.c b/src/slabtest.c index da2c3d4..e120fcb 100644 --- a/src/slabtest.c +++ b/src/slabtest.c @@ -42,7 +42,7 @@ runtest (CCTK_ARGUMENTS, printf ("Mismatch at [%d,%d,%d]: should be %g, is %g\n", cctk_lbnd[0] + i, cctk_lbnd[1] + j, cctk_lbnd[2] + k, - gfz[ind], gfy[ind]); + (double) gfz[ind], (double) gfy[ind]); mismatch = 1; } } @@ -348,4 +348,8 @@ void SlabTest_Test (CCTK_ARGUMENTS) /* TODO: strides, into array, out of array */ + + + + * success = 1; } diff --git a/test/slabtest.par b/test/slabtest.par new file mode 100644 index 0000000..ca68d7a --- /dev/null +++ b/test/slabtest.par @@ -0,0 +1,22 @@ +# $Header$ + +cactus::cctk_itlast = 0 + +ActiveThorns = "IOUtil" + +IO::out_dir = $parfile +IO::parfile_write = no +IO::out_fileinfo = "none" + +ActiveThorns = "PUGH PUGHSlab" + +driver::global_nx = 10 +driver::global_ny = 11 +driver::global_nz = 12 + +ActiveThorns = "Slab SlabTest" + +ActiveThorns = "IOBasic" + +IOBasic::outScalar_every = 1 +IOBasic::outScalar_vars = "SlabTest::success" diff --git a/test/slabtest/success.xg b/test/slabtest/success.xg new file mode 100644 index 0000000..84eaf46 --- /dev/null +++ b/test/slabtest/success.xg @@ -0,0 +1,2 @@ +"success v time +0.0000000000000 1 -- cgit v1.2.3