a0f70b05405bc8bb7c591dd1f5ed9e11b2a208a7
[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 here=`pwd`;
9
10 # ensure that top_srcdir is absolute
11 cd $top_srcdir; top_srcdir=`pwd`
12
13 export STAT_CONFIG_PATH=$top_srcdir/config
14
15
16 cleanup()
17 {
18      if [ x"$PSPP_TEST_NO_CLEANUP" != x ] ; then 
19         echo "NOT cleaning $TEMPDIR"
20         return ; 
21      fi
22      rm -rf $TEMPDIR
23 }
24
25
26 fail()
27 {
28     echo $activity
29     echo FAILED
30     cleanup;
31     exit 1;
32 }
33
34
35 no_result()
36 {
37     echo $activity
38     echo NO RESULT;
39     cleanup;
40     exit 2;
41 }
42
43 pass()
44 {
45     cleanup;
46     exit 0;
47 }
48
49 mkdir -p $TEMPDIR
50
51 cd $TEMPDIR
52
53 put test set up here ...
54 if [ $? -ne 0 ] ; then no_result ; fi
55
56
57 activity="run program"
58 $SUPERVISOR $here/../src/pspp --testing-mode -o raw-ascii $TESTFILE
59 if [ $? -ne 0 ] ; then no_result ; fi
60
61
62
63 put test here
64
65 if [ $? -ne 0 ] ; then fail ; fi
66
67
68 pass;