Added a signal handler for SIGFPE
[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
7 here=`pwd`;
8
9 # ensure that top_srcdir is absolute
10 cd $top_srcdir; top_srcdir=`pwd`
11
12 export STAT_CONFIG_PATH=$top_srcdir/config
13
14
15 cleanup()
16 {
17      rm -rf $TEMPDIR
18 }
19
20
21 fail()
22 {
23     echo $activity
24     echo FAILED
25     cleanup;
26     exit 1;
27 }
28
29
30 no_result()
31 {
32     echo $activity
33     echo NO RESULT;
34     cleanup;
35     exit 2;
36 }
37
38 pass()
39 {
40     cleanup;
41     exit 0;
42 }
43
44 mkdir -p $TEMPDIR
45
46 cd $TEMPDIR
47
48 activity="create program"
49 cat > $TEMPDIR/ct.stat <<EOF
50 DATA LIST FIXED
51      / x   1-2
52        y   3
53        z   4.
54
55 BEGIN DATA.
56 0111 
57 0222 
58 0311 
59 0412 
60 0521 
61 0612 
62 0711 
63 0811 
64 0912 
65 END DATA.
66
67 LIST.
68
69
70 CROSSTABS TABLES  y by z.
71
72 EOF
73 if [ $? -ne 0 ] ; then no_result ; fi
74
75
76 $SUPERVISOR $here/../src/pspp $TEMPDIR/ct.stat
77 if [ $? -ne 0 ] ; then fail ; fi
78
79
80 pass;