7c12397abcd9da03c34ae89c51f13bce8be84128
[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 export STAT_CONFIG_PATH=$top_srcdir/config
17
18 cleanup()
19 {
20      rm -rf $TEMPDIR
21 }
22
23
24 fail()
25 {
26     echo $activity
27     echo FAILED
28     cleanup;
29     exit 1;
30 }
31
32
33 no_result()
34 {
35     echo $activity
36     echo NO RESULT;
37     cleanup;
38     exit 2;
39 }
40
41 pass()
42 {
43     cleanup;
44     exit 0;
45 }
46
47 mkdir -p $TEMPDIR
48
49
50 activity="create data"
51 cat << EOF > $TESTFILE
52
53 data list free /v1 v2.
54 begin data.
55 0 1
56 2 3 
57 4 5
58 3 4
59 end data.
60
61 list.
62
63 frequencies v1 v2.
64 EOF
65 if [ $? -ne 0 ] ; then no_result ; fi
66
67 cd $TEMPDIR
68
69 activity="run data"
70 $SUPERVISOR $here/../src/pspp -o html $TESTFILE
71 if [ $? -ne 0 ] ; then fail ; fi
72
73
74 pass;