Checkin of new directory structure.
[pspp-builds.git] / tests / test_template
1 #!/bin/sh
2
3 # This program tests ....
4
5 TEMPDIR=/tmp/pspp-tst-$$
6 TESTFILE=$TEMPDIR/`basename $0`.sps
7
8 # ensure that top_srcdir and top_builddir  are absolute
9 if [ -z "$top_srcdir" ] ; then top_srcdir=. ; fi
10 if [ -z "$top_builddir" ] ; then top_builddir=. ; fi
11 top_srcdir=`cd $top_srcdir; pwd`
12 top_buiddir=`cd $top_builddir; pwd`
13
14 export STAT_CONFIG_PATH=$top_srcdir/config
15
16
17 cleanup()
18 {
19      if [ x"$PSPP_TEST_NO_CLEANUP" != x ] ; then 
20         echo "NOT cleaning $TEMPDIR"
21         return ; 
22      fi
23      rm -rf $TEMPDIR
24 }
25
26
27 fail()
28 {
29     echo $activity
30     echo FAILED
31     cleanup;
32     exit 1;
33 }
34
35
36 no_result()
37 {
38     echo $activity
39     echo NO RESULT;
40     cleanup;
41     exit 2;
42 }
43
44 pass()
45 {
46     cleanup;
47     exit 0;
48 }
49
50 mkdir -p $TEMPDIR
51
52 cd $TEMPDIR
53
54 put test set up here ...
55 if [ $? -ne 0 ] ; then no_result ; fi
56
57
58 activity="run program"
59 $SUPERVISOR $top_builddir/src/pspp --testing-mode -o raw-ascii $TESTFILE
60 if [ $? -ne 0 ] ; then no_result ; fi
61
62
63
64 put test here
65
66 if [ $? -ne 0 ] ; then fail ; fi
67
68
69 pass;