1635fe589dbabafa8456fbc4b65cf773faf4402e
[pspp-builds.git] / tests / bugs / crosstabs.sh
1 #!/bin/sh
2
3 # This program tests for a bug which crashed pspp when doing a crosstabs
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      rm -rf $TEMPDIR
19 }
20
21
22 fail()
23 {
24     echo $activity
25     echo FAILED
26     cleanup;
27     exit 1;
28 }
29
30
31 no_result()
32 {
33     echo $activity
34     echo NO RESULT;
35     cleanup;
36     exit 2;
37 }
38
39 pass()
40 {
41     cleanup;
42     exit 0;
43 }
44
45 mkdir -p $TEMPDIR
46
47 cd $TEMPDIR
48
49 activity="create program"
50 cat > $TEMPDIR/ct.stat <<EOF
51 DATA LIST FIXED
52      / x   1-2
53        y   3
54        z   4.
55
56 BEGIN DATA.
57 0111 
58 0222 
59 0311 
60 0412 
61 0521 
62 0612 
63 0711 
64 0811 
65 0912 
66 END DATA.
67
68 LIST.
69
70
71 CROSSTABS TABLES  y by z.
72
73 EOF
74 if [ $? -ne 0 ] ; then no_result ; fi
75
76
77 $SUPERVISOR $here/../src/pspp $TEMPDIR/ct.stat
78 if [ $? -ne 0 ] ; then fail ; fi
79
80
81 pass;