7ff29b2d5a07a846e7af3a909ab1fde825e3dbf6
[pspp-builds.git] / tests / bugs / t-test-alpha2.sh
1 #!/bin/sh
2
3 # This program tests that the T-TEST fails gracefully when 
4 #  a single alpha variable is specified for the independent variable
5
6 TEMPDIR=/tmp/pspp-tst-$$
7 TESTFILE=$TEMPDIR/`basename $0`.sps
8
9 here=`pwd`;
10
11 # ensure that top_srcdir is absolute
12 cd $top_srcdir; top_srcdir=`pwd`
13
14 STAT_CONFIG_PATH=$top_srcdir/config
15 export STAT_CONFIG_PATH
16
17
18 cleanup()
19 {
20      cd /
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 cd $TEMPDIR
51
52 activity="create program"
53 cat > $TESTFILE <<EOF
54 data list list /id * indep (a1) dep1 * dep2 *.
55 begin data.
56 1  'a' 1 3
57 2  'a' 2 4
58 3  'a' 2 4 
59 4  'a' 2 4 
60 5  'a' 3 5
61 6  'b' 3 1
62 7  'b' 4 2
63 8  'b' 4 2
64 9  'b' 4 2
65 10 'b' 5 3
66 11 'c' 2 2
67 end data.
68
69
70 t-test /GROUPS=indep('a') /var=dep1 dep2.
71 EOF
72 if [ $? -ne 0 ] ; then no_result ; fi
73
74
75 activity="run program"
76 $SUPERVISOR $here/../src/pspp -o raw-ascii $TESTFILE > /dev/null
77 #invert  v
78 if [ $? -eq 0 ] ; then fail ; fi
79
80
81 pass