From cbf8e7c5bc9db1c5592ac122d1c13b11a3ed5847 Mon Sep 17 00:00:00 2001 From: Takeshi Nakazato Date: Thu, 29 Jul 2021 11:47:46 +0900 Subject: [PATCH] Define minimal set of verification tests in tMSTimeGram --- ms/MSSel/test/tMSTimeGram.out | 8 +++++++ ms/MSSel/test/tMSTimeGram.run | 42 +++++++++++++++++++++++++++++++++-- 2 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 ms/MSSel/test/tMSTimeGram.out diff --git a/ms/MSSel/test/tMSTimeGram.out b/ms/MSSel/test/tMSTimeGram.out new file mode 100644 index 00000000000..1fc92dd16b0 --- /dev/null +++ b/ms/MSSel/test/tMSTimeGram.out @@ -0,0 +1,8 @@ +Original table has rows 1058 +TableExprNode has rows = 1058 +After mssel constructor called +selected table has rows 46 +Original table has rows 1058 +TableExprNode has rows = 1058 +After mssel constructor called +selected table has rows 46 diff --git a/ms/MSSel/test/tMSTimeGram.run b/ms/MSSel/test/tMSTimeGram.run index 66c49c44a31..b9afb93e26c 100644 --- a/ms/MSSel/test/tMSTimeGram.run +++ b/ms/MSSel/test/tMSTimeGram.run @@ -1,3 +1,41 @@ #! /bin/sh -echo "UNTESTED" -exit 3 +# ----------------------------------------------------------------------------- +# Usage: tMSTimeGram.run +# ----------------------------------------------------------------------------- +# This script executes the program tMSTimeGram to test the +# MSTimeGram module. +# +# $Id$ +#----------------------------------------------------------------------------- + + MS=$CASADEMO"mssel_test_small.ms" + + runCmd(){ + # Uncomment following line to generate an output close to a + # script to run the tests + #echo "#Test:$1"; echo $3; + + eval "$2 $3" + } + + getTestMS() { + tar zxf $testsrcdir/$MS.tgz + } + + cleanup() { + \rm -rf $MS + } + + # Get the test MS (un-tar it from $testsrcdir). + getTestMS; + + # T1~T2 syntax: selects single timestamp, 2014/09/20/10:37:51.360000 + runCmd 1 "$casa_checktool" " ./tMSTimeGram $MS '2014/09/20/10:37:51.0~10:37:51.5'"; + + # T+dT syntax: selects single timestamp, 2014/09/20/10:37:51.360000 + runCmd 2 "$casa_checktool" " ./tMSTimeGram $MS '2014/09/20/10:37:51.0+0:0:0.5'"; + + # + # Remove the test MS and any other cleanup required. + # + cleanup;