e3df6fdeddc10d0a1ae6741cdb40c01aa77dacf1
[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      cd /
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
52 activity="create data"
53 cat << EOF > $TESTFILE
54
55 data list free /v1 v2.
56 begin data.
57 0 1
58 2 3 
59 4 5
60 3 4
61 end data.
62
63 list.
64
65 frequencies v1 v2.
66 EOF
67 if [ $? -ne 0 ] ; then no_result ; fi
68
69 cd $TEMPDIR
70
71 activity="run data"
72 $SUPERVISOR $here/../src/pspp -o html $TESTFILE
73 if [ $? -ne 0 ] ; then fail ; fi
74
75
76 pass;