3 # This program tests epochs by running DEBUG EPOCH.
5 TEMPDIR=/tmp/pspp-tst-$$
7 # ensure that top_srcdir and top_builddir are absolute
8 if [ -z "$top_srcdir" ] ; then top_srcdir=. ; fi
9 if [ -z "$top_builddir" ] ; then top_builddir=. ; fi
10 top_srcdir=`cd $top_srcdir; pwd`
11 top_builddir=`cd $top_builddir; pwd`
12 PSPP=$top_builddir/src/ui/terminal/pspp
15 STAT_CONFIG_PATH=$top_srcdir/config
16 export STAT_CONFIG_PATH
53 activity="create program"
54 cat > $TEMPDIR/epoch.stat <<EOF
59 DEBUG EVALUATE/YRMODA(0,1,1) = YRMODA(1900,1,1).
60 DEBUG EVALUATE/YRMODA(1,1,1) = YRMODA(1901,1,1).
61 DEBUG EVALUATE/YRMODA(12,1,1) = YRMODA(1912,1,1).
62 DEBUG EVALUATE/YRMODA(70,1,1) = YRMODA(1970,1,1).
63 DEBUG EVALUATE/YRMODA(87,1,1) = YRMODA(1987,1,1).
64 DEBUG EVALUATE/YRMODA(99,1,1) = YRMODA(1999,1,1).
65 DEBUG EVALUATE/YRMODA(100,1,1).
66 DEBUG EVALUATE/DATE.DMY(1,1,0) = DATE.DMY(1,1,1900).
67 DEBUG EVALUATE/DATE.DMY(1,1,1) = DATE.DMY(1,1,1901).
68 DEBUG EVALUATE/DATE.DMY(1,1,12) = DATE.DMY(1,1,1912).
69 DEBUG EVALUATE/DATE.DMY(1,1,70) = DATE.DMY(1,1,1970).
70 DEBUG EVALUATE/DATE.DMY(1,1,87) = DATE.DMY(1,1,1987).
71 DEBUG EVALUATE/DATE.DMY(1,1,99) = DATE.DMY(1,1,1999).
72 DEBUG EVALUATE/DATE.DMY(1,1,100).
75 DEBUG EVALUATE/YRMODA(0,1,1) = YRMODA(1900,1,1).
76 DEBUG EVALUATE/YRMODA(1,1,1) = YRMODA(1901,1,1).
77 DEBUG EVALUATE/YRMODA(12,1,1) = YRMODA(1912,1,1).
78 DEBUG EVALUATE/YRMODA(70,1,1) = YRMODA(1970,1,1).
79 DEBUG EVALUATE/YRMODA(87,1,1) = YRMODA(1987,1,1).
80 DEBUG EVALUATE/YRMODA(99,1,1) = YRMODA(1999,1,1).
81 DEBUG EVALUATE/YRMODA(100,1,1).
82 DEBUG EVALUATE/DATE.DMY(1,1,0) = DATE.DMY(1,1,2000).
83 DEBUG EVALUATE/DATE.DMY(1,1,1) = DATE.DMY(1,1,1901).
84 DEBUG EVALUATE/DATE.DMY(1,1,12) = DATE.DMY(1,1,1912).
85 DEBUG EVALUATE/DATE.DMY(1,1,70) = DATE.DMY(1,1,1970).
86 DEBUG EVALUATE/DATE.DMY(1,1,87) = DATE.DMY(1,1,1987).
87 DEBUG EVALUATE/DATE.DMY(1,1,99) = DATE.DMY(1,1,1999).
88 DEBUG EVALUATE/DATE.DMY(1,1,100).
91 DEBUG EVALUATE/YRMODA(0,1,1) = YRMODA(1900,1,1).
92 DEBUG EVALUATE/YRMODA(1,1,1) = YRMODA(1901,1,1).
93 DEBUG EVALUATE/YRMODA(12,1,1) = YRMODA(1912,1,1).
94 DEBUG EVALUATE/YRMODA(70,1,1) = YRMODA(1970,1,1).
95 DEBUG EVALUATE/YRMODA(87,1,1) = YRMODA(1987,1,1).
96 DEBUG EVALUATE/YRMODA(99,1,1) = YRMODA(1999,1,1).
97 DEBUG EVALUATE/YRMODA(100,1,1).
98 DEBUG EVALUATE/DATE.DMY(1,1,0) = DATE.DMY(1,1,2000).
99 DEBUG EVALUATE/DATE.DMY(1,1,1) = DATE.DMY(1,1,2001).
100 DEBUG EVALUATE/DATE.DMY(1,1,12) = DATE.DMY(1,1,1912).
101 DEBUG EVALUATE/DATE.DMY(1,1,70) = DATE.DMY(1,1,1970).
102 DEBUG EVALUATE/DATE.DMY(1,1,87) = DATE.DMY(1,1,1987).
103 DEBUG EVALUATE/DATE.DMY(1,1,99) = DATE.DMY(1,1,1999).
104 DEBUG EVALUATE/DATE.DMY(1,1,100).
107 DEBUG EVALUATE/YRMODA(0,1,1) = YRMODA(1900,1,1).
108 DEBUG EVALUATE/YRMODA(1,1,1) = YRMODA(1901,1,1).
109 DEBUG EVALUATE/YRMODA(12,1,1) = YRMODA(1912,1,1).
110 DEBUG EVALUATE/YRMODA(70,1,1) = YRMODA(1970,1,1).
111 DEBUG EVALUATE/YRMODA(87,1,1) = YRMODA(1987,1,1).
112 DEBUG EVALUATE/YRMODA(99,1,1) = YRMODA(1999,1,1).
113 DEBUG EVALUATE/YRMODA(100,1,1).
114 DEBUG EVALUATE/DATE.DMY(1,1,0) = DATE.DMY(1,1,2000).
115 DEBUG EVALUATE/DATE.DMY(1,1,1) = DATE.DMY(1,1,2001).
116 DEBUG EVALUATE/DATE.DMY(1,1,12) = DATE.DMY(1,1,1912).
117 DEBUG EVALUATE/DATE.DMY(1,1,70) = DATE.DMY(1,1,1970).
118 DEBUG EVALUATE/DATE.DMY(1,1,87) = DATE.DMY(1,1,1987).
119 DEBUG EVALUATE/DATE.DMY(1,1,99) = DATE.DMY(1,1,1999).
120 DEBUG EVALUATE/DATE.DMY(1,1,100).
123 DEBUG EVALUATE/YRMODA(0,1,1) = YRMODA(1900,1,1).
124 DEBUG EVALUATE/YRMODA(1,1,1) = YRMODA(1901,1,1).
125 DEBUG EVALUATE/YRMODA(12,1,1) = YRMODA(1912,1,1).
126 DEBUG EVALUATE/YRMODA(70,1,1) = YRMODA(1970,1,1).
127 DEBUG EVALUATE/YRMODA(87,1,1) = YRMODA(1987,1,1).
128 DEBUG EVALUATE/YRMODA(99,1,1) = YRMODA(1999,1,1).
129 DEBUG EVALUATE/YRMODA(100,1,1).
130 DEBUG EVALUATE/DATE.DMY(1,1,0) = DATE.DMY(1,1,2100).
131 DEBUG EVALUATE/DATE.DMY(1,1,1) = DATE.DMY(1,1,2101).
132 DEBUG EVALUATE/DATE.DMY(1,1,12) = DATE.DMY(1,1,2012).
133 DEBUG EVALUATE/DATE.DMY(1,1,70) = DATE.DMY(1,1,2070).
134 DEBUG EVALUATE/DATE.DMY(1,1,87) = DATE.DMY(1,1,2087).
135 DEBUG EVALUATE/DATE.DMY(1,1,99) = DATE.DMY(1,1,2099).
136 DEBUG EVALUATE/DATE.DMY(1,1,100).
138 if [ $? -ne 0 ] ; then no_result ; fi
140 activity="run program"
141 $SUPERVISOR $PSPP --testing-mode $TEMPDIR/epoch.stat > $TEMPDIR/epoch.err 2> $TEMPDIR/epoch.out
143 activity="compare results"
144 perl -pi -e 's/^\s*$//g' $TEMPDIR/epoch.out
145 diff -b $TEMPDIR/epoch.out - <<EOF
146 YRMODA(0,1,1) = YRMODA(1900,1,1) => true
147 YRMODA(1,1,1) = YRMODA(1901,1,1) => true
148 YRMODA(12,1,1) = YRMODA(1912,1,1) => true
149 YRMODA(70,1,1) = YRMODA(1970,1,1) => true
150 YRMODA(87,1,1) = YRMODA(1987,1,1) => true
151 YRMODA(99,1,1) = YRMODA(1999,1,1) => true
152 YRMODA(100,1,1) => sysmis
153 DATE.DMY(1,1,0) = DATE.DMY(1,1,1900) => true
154 DATE.DMY(1,1,1) = DATE.DMY(1,1,1901) => true
155 DATE.DMY(1,1,12) = DATE.DMY(1,1,1912) => true
156 DATE.DMY(1,1,70) = DATE.DMY(1,1,1970) => true
157 DATE.DMY(1,1,87) = DATE.DMY(1,1,1987) => true
158 DATE.DMY(1,1,99) = DATE.DMY(1,1,1999) => true
159 DATE.DMY(1,1,100) => sysmis
160 YRMODA(0,1,1) = YRMODA(1900,1,1) => true
161 YRMODA(1,1,1) = YRMODA(1901,1,1) => true
162 YRMODA(12,1,1) = YRMODA(1912,1,1) => true
163 YRMODA(70,1,1) = YRMODA(1970,1,1) => true
164 YRMODA(87,1,1) = YRMODA(1987,1,1) => true
165 YRMODA(99,1,1) = YRMODA(1999,1,1) => true
166 YRMODA(100,1,1) => sysmis
167 DATE.DMY(1,1,0) = DATE.DMY(1,1,2000) => true
168 DATE.DMY(1,1,1) = DATE.DMY(1,1,1901) => true
169 DATE.DMY(1,1,12) = DATE.DMY(1,1,1912) => true
170 DATE.DMY(1,1,70) = DATE.DMY(1,1,1970) => true
171 DATE.DMY(1,1,87) = DATE.DMY(1,1,1987) => true
172 DATE.DMY(1,1,99) = DATE.DMY(1,1,1999) => true
173 DATE.DMY(1,1,100) => sysmis
174 YRMODA(0,1,1) = YRMODA(1900,1,1) => true
175 YRMODA(1,1,1) = YRMODA(1901,1,1) => true
176 YRMODA(12,1,1) = YRMODA(1912,1,1) => true
177 YRMODA(70,1,1) = YRMODA(1970,1,1) => true
178 YRMODA(87,1,1) = YRMODA(1987,1,1) => true
179 YRMODA(99,1,1) = YRMODA(1999,1,1) => true
180 YRMODA(100,1,1) => sysmis
181 DATE.DMY(1,1,0) = DATE.DMY(1,1,2000) => true
182 DATE.DMY(1,1,1) = DATE.DMY(1,1,2001) => true
183 DATE.DMY(1,1,12) = DATE.DMY(1,1,1912) => true
184 DATE.DMY(1,1,70) = DATE.DMY(1,1,1970) => true
185 DATE.DMY(1,1,87) = DATE.DMY(1,1,1987) => true
186 DATE.DMY(1,1,99) = DATE.DMY(1,1,1999) => true
187 DATE.DMY(1,1,100) => sysmis
188 YRMODA(0,1,1) = YRMODA(1900,1,1) => true
189 YRMODA(1,1,1) = YRMODA(1901,1,1) => true
190 YRMODA(12,1,1) = YRMODA(1912,1,1) => true
191 YRMODA(70,1,1) = YRMODA(1970,1,1) => true
192 YRMODA(87,1,1) = YRMODA(1987,1,1) => true
193 YRMODA(99,1,1) = YRMODA(1999,1,1) => true
194 YRMODA(100,1,1) => sysmis
195 DATE.DMY(1,1,0) = DATE.DMY(1,1,2000) => true
196 DATE.DMY(1,1,1) = DATE.DMY(1,1,2001) => true
197 DATE.DMY(1,1,12) = DATE.DMY(1,1,1912) => true
198 DATE.DMY(1,1,70) = DATE.DMY(1,1,1970) => true
199 DATE.DMY(1,1,87) = DATE.DMY(1,1,1987) => true
200 DATE.DMY(1,1,99) = DATE.DMY(1,1,1999) => true
201 DATE.DMY(1,1,100) => sysmis
202 YRMODA(0,1,1) = YRMODA(1900,1,1) => true
203 YRMODA(1,1,1) = YRMODA(1901,1,1) => true
204 YRMODA(12,1,1) = YRMODA(1912,1,1) => true
205 YRMODA(70,1,1) = YRMODA(1970,1,1) => true
206 YRMODA(87,1,1) = YRMODA(1987,1,1) => true
207 YRMODA(99,1,1) = YRMODA(1999,1,1) => true
208 YRMODA(100,1,1) => sysmis
209 DATE.DMY(1,1,0) = DATE.DMY(1,1,2100) => true
210 DATE.DMY(1,1,1) = DATE.DMY(1,1,2101) => true
211 DATE.DMY(1,1,12) = DATE.DMY(1,1,2012) => true
212 DATE.DMY(1,1,70) = DATE.DMY(1,1,2070) => true
213 DATE.DMY(1,1,87) = DATE.DMY(1,1,2087) => true
214 DATE.DMY(1,1,99) = DATE.DMY(1,1,2099) => true
215 DATE.DMY(1,1,100) => sysmis
217 if [ $? -ne 0 ] ; then no_result ; fi