Changed the default value od SCOMPRESS to true.
[pspp-builds.git] / tests / command / oneway-missing.sh
1 #!/bin/sh
2
3 # This program tests that the ONEWAY anova command works OK when there is missing data
4
5 TEMPDIR=/tmp/pspp-tst-$$
6 TESTFILE=$TEMPDIR/`basename $0`.sps
7
8 # ensure that top_builddir  are absolute
9 if [ -z "$top_builddir" ] ; then top_builddir=. ; fi
10 if [ -z "$top_srcdir" ] ; then top_srcdir=. ; fi
11 top_builddir=`cd $top_builddir; pwd`
12 PSPP=$top_builddir/src/ui/terminal/pspp
13
14 # ensure that top_srcdir is absolute
15 top_srcdir=`cd $top_srcdir; pwd`
16
17 STAT_CONFIG_PATH=$top_srcdir/config
18 export STAT_CONFIG_PATH
19
20
21 cleanup()
22 {
23      cd /
24      rm -rf $TEMPDIR
25 }
26
27
28 fail()
29 {
30     echo $activity
31     echo FAILED
32     cleanup;
33     exit 1;
34 }
35
36
37 no_result()
38 {
39     echo $activity
40     echo NO RESULT;
41     cleanup;
42     exit 2;
43 }
44
45 pass()
46 {
47     cleanup;
48     exit 0;
49 }
50
51 mkdir -p $TEMPDIR
52
53 cd $TEMPDIR
54
55 activity="create program"
56 cat > $TESTFILE <<EOF
57 DATA LIST LIST /v1 * v2 * dep * vn *.
58 BEGIN DATA
59 . .  1  4
60 3 3  1  2
61 2 2  1  2
62 1 1  1  2
63 1 1  1  2
64 4 4  1  2
65 5 5  2  2
66 2 2  2  2
67 4 4  2  2
68 2 2  2  2
69 3 3  2  2
70 7 7  3  2
71 4 4  3  2
72 5 5  3  2
73 3 3  3  2
74 6 6  3  2
75 END DATA
76
77 ONEWAY
78         v1 v2 BY dep
79         /STATISTICS descriptives homogeneity
80         /MISSING ANALYSIS 
81         .
82 EOF
83 if [ $? -ne 0 ] ; then no_result ; fi
84
85
86 activity="run program"
87 $SUPERVISOR $PSPP -o raw-ascii $TESTFILE
88 if [ $? -ne 0 ] ; then no_result ; fi
89
90 activity="copy output"
91 cp $TEMPDIR/pspp.list $TEMPDIR/pspp.list1
92 if [ $? -ne 0 ] ; then no_result ; fi
93
94 activity="create program 2"
95 cat > $TESTFILE <<EOF
96 DATA LIST LIST /v1 * v2 * dep * vn * .
97 BEGIN DATA
98 4 .  1  2 
99 3 3  1  2
100 2 2  1  2
101 1 1  1  2
102 1 1  1  2
103 4 4  1  2
104 5 5  2  2
105 2 2  2  2
106 4 4  2  2
107 2 2  2  2
108 3 3  2  2
109 7 7  3  2
110 4 4  3  2
111 5 5  3  2
112 3 3  3  2
113 6 6  3  2
114 END DATA
115
116 ONEWAY
117         v1 v2 BY dep
118         /STATISTICS descriptives homogeneity
119         /MISSING LISTWISE
120         .
121 EOF
122 if [ $? -ne 0 ] ; then no_result ; fi
123
124 activity="run program 2"
125 $SUPERVISOR $PSPP -o raw-ascii $TESTFILE
126 if [ $? -ne 0 ] ; then no_result ; fi
127
128 activity="compare outputs"
129 diff $TEMPDIR/pspp.list $TEMPDIR/pspp.list1
130 if [ $? -ne 0 ] ; then fail ; fi
131
132 # Now try a missing dependent variable
133 # Everything depends upon it, so it should behave as if LISTWISE were set
134 activity="create program 3"
135 cat > $TESTFILE <<EOF
136 DATA LIST LIST /v1 * v2 * dep * vn * .
137 BEGIN DATA
138 4 2  .  2 
139 3 3  1  2
140 2 2  1  2
141 1 1  1  2
142 1 1  1  2
143 4 4  1  2
144 5 5  2  2
145 2 2  2  2
146 4 4  2  2
147 2 2  2  2
148 3 3  2  2
149 7 7  3  2
150 4 4  3  2
151 5 5  3  2
152 3 3  3  2
153 6 6  3  2
154 END DATA
155
156 ONEWAY
157         v1 v2 BY dep
158         /STATISTICS descriptives homogeneity
159         /MISSING ANALYSIS
160         .
161 EOF
162 if [ $? -ne 0 ] ; then no_result ; fi
163
164 activity="run program 3"
165 $SUPERVISOR $PSPP -o raw-ascii $TESTFILE
166 if [ $? -ne 0 ] ; then no_result ; fi
167
168 activity="compare outputs"
169 diff $TEMPDIR/pspp.list $TEMPDIR/pspp.list1
170 if [ $? -ne 0 ] ; then fail ; fi
171
172
173 pass