Fix use of "export" to work with traditional shells.
[pspp-builds.git] / tests / bugs / html-frequency.sh
1 #!/bin/sh
2
3 # This program tests for a bug where pspp would crash 
4 # when a FREQUENCIES command was used with the html 
5 # driver.
6
7
8 TEMPDIR=/tmp/pspp-tst-$$
9 TESTFILE=$TEMPDIR/`basename $0`.sps
10
11 here=`pwd`
12
13 # ensure that top_srcdir is absolute
14 cd $top_srcdir ; top_srcdir=`pwd`
15
16 STAT_CONFIG_PATH=$top_srcdir/config
17 export STAT_CONFIG_PATH
18
19 cleanup()
20 {
21      rm -rf $TEMPDIR
22 }
23
24
25 fail()
26 {
27     echo $activity
28     echo FAILED
29     cleanup;
30     exit 1;
31 }
32
33
34 no_result()
35 {
36     echo $activity
37     echo NO RESULT;
38     cleanup;
39     exit 2;
40 }
41
42 pass()
43 {
44     cleanup;
45     exit 0;
46 }
47
48 mkdir -p $TEMPDIR
49
50
51 activity="create data"
52 cat << EOF > $TESTFILE
53
54 data list free /v1 v2.
55 begin data.
56 0 1
57 2 3 
58 4 5
59 3 4
60 end data.
61
62 list.
63
64 frequencies v1 v2.
65 EOF
66 if [ $? -ne 0 ] ; then no_result ; fi
67
68 cd $TEMPDIR
69
70 activity="run data"
71 $SUPERVISOR $here/../src/pspp -o html $TESTFILE
72 if [ $? -ne 0 ] ; then fail ; fi
73
74
75 pass;