Fix crash when opening empty dataset
[pspp-builds.git] / tests / formats / month-out.sh
1 #! /bin/sh
2
3 TEMPDIR=/tmp/pspp-tst-$$
4 mkdir -p $TEMPDIR
5 trap 'cd /; rm -rf $TEMPDIR' 0
6
7 # ensure that top_builddir  are absolute
8 if [ -z "$top_builddir" ] ; then top_builddir=. ; fi
9 if [ -z "$top_srcdir" ] ; then top_srcdir=. ; fi
10 top_builddir=`cd $top_builddir; pwd`
11 PSPP=$top_builddir/src/ui/terminal/pspp
12
13 # ensure that top_srcdir is absolute
14 top_srcdir=`cd $top_srcdir; pwd`
15
16 STAT_CONFIG_PATH=$top_srcdir/config
17 export STAT_CONFIG_PATH
18
19 fail()
20 {
21     echo $activity
22     echo FAILED
23     exit 1;
24 }
25
26
27 no_result()
28 {
29     echo $activity
30     echo NO RESULT;
31     exit 2;
32 }
33
34 pass()
35 {
36     exit 0;
37 }
38
39 cd $TEMPDIR
40
41 activity="write pspp syntax"
42 cat > month-out.pspp <<EOF
43 set errors=none.
44 set mxwarns=10000000.
45 data list /x 1-10.
46 begin data.
47
48 0
49 0.5
50 0.9
51 1
52 2
53 3
54 4
55 4.1
56 4.5
57 4.9
58 5
59 6
60 7
61 7.1
62 7.5
63 7.9
64 8
65 9
66 10
67 11
68 12
69 13
70 end data.
71 print outfile='month-out.out'/x(month3).
72 print outfile='month-out.out'/x(month4).
73 print outfile='month-out.out'/x(month5).
74 print outfile='month-out.out'/x(month6).
75 print outfile='month-out.out'/x(month7).
76 print outfile='month-out.out'/x(month8).
77 print outfile='month-out.out'/x(month9).
78 print outfile='month-out.out'/x(month10).
79 print outfile='month-out.out'/x(month11).
80 print outfile='month-out.out'/x(month12).
81 print outfile='month-out.out'/x(month13).
82 print outfile='month-out.out'/x(month14).
83 print outfile='month-out.out'/x(month15).
84 print outfile='month-out.out'/x(month16).
85 print outfile='month-out.out'/x(month17).
86 print outfile='month-out.out'/x(month18).
87 print outfile='month-out.out'/x(month19).
88 print outfile='month-out.out'/x(month20).
89 print outfile='month-out.out'/x(month21).
90 print outfile='month-out.out'/x(month22).
91 print outfile='month-out.out'/x(month23).
92 print outfile='month-out.out'/x(month24).
93 print outfile='month-out.out'/x(month25).
94 print outfile='month-out.out'/x(month26).
95 print outfile='month-out.out'/x(month27).
96 print outfile='month-out.out'/x(month28).
97 print outfile='month-out.out'/x(month29).
98 print outfile='month-out.out'/x(month30).
99 print outfile='month-out.out'/x(month31).
100 print outfile='month-out.out'/x(month32).
101 print outfile='month-out.out'/x(month33).
102 print outfile='month-out.out'/x(month34).
103 print outfile='month-out.out'/x(month35).
104 print outfile='month-out.out'/x(month36).
105 print outfile='month-out.out'/x(month37).
106 print outfile='month-out.out'/x(month38).
107 print outfile='month-out.out'/x(month39).
108 print outfile='month-out.out'/x(month40).
109 execute.
110 EOF
111 if [ $? -ne 0 ] ; then no_result ; fi
112
113 activity="run program"
114 $SUPERVISOR $PSPP --testing-mode month-out.pspp
115 if [ $? -eq 0 ] ; then no_result ; fi
116
117 activity="compare output"
118 diff -u month-out.out - <<EOF 
119    .
120     .
121      .
122       .
123        .
124         .
125          .
126           .
127            .
128             .
129              .
130               .
131                .
132                 .
133                  .
134                   .
135                    .
136                     .
137                      .
138                       .
139                        .
140                         .
141                          .
142                           .
143                            .
144                             .
145                              .
146                               .
147                                .
148                                 .
149                                  .
150                                   .
151                                    .
152                                     .
153                                      .
154                                       .
155                                        .
156                                         .
157    .
158     .
159      .
160       .
161        .
162         .
163          .
164           .
165            .
166             .
167              .
168               .
169                .
170                 .
171                  .
172                   .
173                    .
174                     .
175                      .
176                       .
177                        .
178                         .
179                          .
180                           .
181                            .
182                             .
183                              .
184                               .
185                                .
186                                 .
187                                  .
188                                   .
189                                    .
190                                     .
191                                      .
192                                       .
193                                        .
194                                         .
195    .
196     .
197      .
198       .
199        .
200         .
201          .
202           .
203            .
204             .
205              .
206               .
207                .
208                 .
209                  .
210                   .
211                    .
212                     .
213                      .
214                       .
215                        .
216                         .
217                          .
218                           .
219                            .
220                             .
221                              .
222                               .
223                                .
224                                 .
225                                  .
226                                   .
227                                    .
228                                     .
229                                      .
230                                       .
231                                        .
232                                         .
233    .
234     .
235      .
236       .
237        .
238         .
239          .
240           .
241            .
242             .
243              .
244               .
245                .
246                 .
247                  .
248                   .
249                    .
250                     .
251                      .
252                       .
253                        .
254                         .
255                          .
256                           .
257                            .
258                             .
259                              .
260                               .
261                                .
262                                 .
263                                  .
264                                   .
265                                    .
266                                     .
267                                      .
268                                       .
269                                        .
270                                         .
271  JAN
272  JANU
273  JANUA
274  JANUAR
275  JANUARY
276  JANUARY 
277  JANUARY  
278  JANUARY   
279  JANUARY    
280  JANUARY     
281  JANUARY      
282  JANUARY       
283  JANUARY        
284  JANUARY         
285  JANUARY          
286  JANUARY           
287  JANUARY            
288  JANUARY             
289  JANUARY              
290  JANUARY               
291  JANUARY                
292  JANUARY                 
293  JANUARY                  
294  JANUARY                   
295  JANUARY                    
296  JANUARY                     
297  JANUARY                      
298  JANUARY                       
299  JANUARY                        
300  JANUARY                         
301  JANUARY                          
302  JANUARY                           
303  JANUARY                            
304  JANUARY                             
305  JANUARY                              
306  JANUARY                               
307  JANUARY                                
308  JANUARY                                 
309  FEB
310  FEBR
311  FEBRU
312  FEBRUA
313  FEBRUAR
314  FEBRUARY
315  FEBRUARY 
316  FEBRUARY  
317  FEBRUARY   
318  FEBRUARY    
319  FEBRUARY     
320  FEBRUARY      
321  FEBRUARY       
322  FEBRUARY        
323  FEBRUARY         
324  FEBRUARY          
325  FEBRUARY           
326  FEBRUARY            
327  FEBRUARY             
328  FEBRUARY              
329  FEBRUARY               
330  FEBRUARY                
331  FEBRUARY                 
332  FEBRUARY                  
333  FEBRUARY                   
334  FEBRUARY                    
335  FEBRUARY                     
336  FEBRUARY                      
337  FEBRUARY                       
338  FEBRUARY                        
339  FEBRUARY                         
340  FEBRUARY                          
341  FEBRUARY                           
342  FEBRUARY                            
343  FEBRUARY                             
344  FEBRUARY                              
345  FEBRUARY                               
346  FEBRUARY                                
347  MAR
348  MARC
349  MARCH
350  MARCH 
351  MARCH  
352  MARCH   
353  MARCH    
354  MARCH     
355  MARCH      
356  MARCH       
357  MARCH        
358  MARCH         
359  MARCH          
360  MARCH           
361  MARCH            
362  MARCH             
363  MARCH              
364  MARCH               
365  MARCH                
366  MARCH                 
367  MARCH                  
368  MARCH                   
369  MARCH                    
370  MARCH                     
371  MARCH                      
372  MARCH                       
373  MARCH                        
374  MARCH                         
375  MARCH                          
376  MARCH                           
377  MARCH                            
378  MARCH                             
379  MARCH                              
380  MARCH                               
381  MARCH                                
382  MARCH                                 
383  MARCH                                  
384  MARCH                                   
385  APR
386  APRI
387  APRIL
388  APRIL 
389  APRIL  
390  APRIL   
391  APRIL    
392  APRIL     
393  APRIL      
394  APRIL       
395  APRIL        
396  APRIL         
397  APRIL          
398  APRIL           
399  APRIL            
400  APRIL             
401  APRIL              
402  APRIL               
403  APRIL                
404  APRIL                 
405  APRIL                  
406  APRIL                   
407  APRIL                    
408  APRIL                     
409  APRIL                      
410  APRIL                       
411  APRIL                        
412  APRIL                         
413  APRIL                          
414  APRIL                           
415  APRIL                            
416  APRIL                             
417  APRIL                              
418  APRIL                               
419  APRIL                                
420  APRIL                                 
421  APRIL                                  
422  APRIL                                   
423  APR
424  APRI
425  APRIL
426  APRIL 
427  APRIL  
428  APRIL   
429  APRIL    
430  APRIL     
431  APRIL      
432  APRIL       
433  APRIL        
434  APRIL         
435  APRIL          
436  APRIL           
437  APRIL            
438  APRIL             
439  APRIL              
440  APRIL               
441  APRIL                
442  APRIL                 
443  APRIL                  
444  APRIL                   
445  APRIL                    
446  APRIL                     
447  APRIL                      
448  APRIL                       
449  APRIL                        
450  APRIL                         
451  APRIL                          
452  APRIL                           
453  APRIL                            
454  APRIL                             
455  APRIL                              
456  APRIL                               
457  APRIL                                
458  APRIL                                 
459  APRIL                                  
460  APRIL                                   
461  APR
462  APRI
463  APRIL
464  APRIL 
465  APRIL  
466  APRIL   
467  APRIL    
468  APRIL     
469  APRIL      
470  APRIL       
471  APRIL        
472  APRIL         
473  APRIL          
474  APRIL           
475  APRIL            
476  APRIL             
477  APRIL              
478  APRIL               
479  APRIL                
480  APRIL                 
481  APRIL                  
482  APRIL                   
483  APRIL                    
484  APRIL                     
485  APRIL                      
486  APRIL                       
487  APRIL                        
488  APRIL                         
489  APRIL                          
490  APRIL                           
491  APRIL                            
492  APRIL                             
493  APRIL                              
494  APRIL                               
495  APRIL                                
496  APRIL                                 
497  APRIL                                  
498  APRIL                                   
499  APR
500  APRI
501  APRIL
502  APRIL 
503  APRIL  
504  APRIL   
505  APRIL    
506  APRIL     
507  APRIL      
508  APRIL       
509  APRIL        
510  APRIL         
511  APRIL          
512  APRIL           
513  APRIL            
514  APRIL             
515  APRIL              
516  APRIL               
517  APRIL                
518  APRIL                 
519  APRIL                  
520  APRIL                   
521  APRIL                    
522  APRIL                     
523  APRIL                      
524  APRIL                       
525  APRIL                        
526  APRIL                         
527  APRIL                          
528  APRIL                           
529  APRIL                            
530  APRIL                             
531  APRIL                              
532  APRIL                               
533  APRIL                                
534  APRIL                                 
535  APRIL                                  
536  APRIL                                   
537  MAY
538  MAY 
539  MAY  
540  MAY   
541  MAY    
542  MAY     
543  MAY      
544  MAY       
545  MAY        
546  MAY         
547  MAY          
548  MAY           
549  MAY            
550  MAY             
551  MAY              
552  MAY               
553  MAY                
554  MAY                 
555  MAY                  
556  MAY                   
557  MAY                    
558  MAY                     
559  MAY                      
560  MAY                       
561  MAY                        
562  MAY                         
563  MAY                          
564  MAY                           
565  MAY                            
566  MAY                             
567  MAY                              
568  MAY                               
569  MAY                                
570  MAY                                 
571  MAY                                  
572  MAY                                   
573  MAY                                    
574  MAY                                     
575  JUN
576  JUNE
577  JUNE 
578  JUNE  
579  JUNE   
580  JUNE    
581  JUNE     
582  JUNE      
583  JUNE       
584  JUNE        
585  JUNE         
586  JUNE          
587  JUNE           
588  JUNE            
589  JUNE             
590  JUNE              
591  JUNE               
592  JUNE                
593  JUNE                 
594  JUNE                  
595  JUNE                   
596  JUNE                    
597  JUNE                     
598  JUNE                      
599  JUNE                       
600  JUNE                        
601  JUNE                         
602  JUNE                          
603  JUNE                           
604  JUNE                            
605  JUNE                             
606  JUNE                              
607  JUNE                               
608  JUNE                                
609  JUNE                                 
610  JUNE                                  
611  JUNE                                   
612  JUNE                                    
613  JUL
614  JULY
615  JULY 
616  JULY  
617  JULY   
618  JULY    
619  JULY     
620  JULY      
621  JULY       
622  JULY        
623  JULY         
624  JULY          
625  JULY           
626  JULY            
627  JULY             
628  JULY              
629  JULY               
630  JULY                
631  JULY                 
632  JULY                  
633  JULY                   
634  JULY                    
635  JULY                     
636  JULY                      
637  JULY                       
638  JULY                        
639  JULY                         
640  JULY                          
641  JULY                           
642  JULY                            
643  JULY                             
644  JULY                              
645  JULY                               
646  JULY                                
647  JULY                                 
648  JULY                                  
649  JULY                                   
650  JULY                                    
651  JUL
652  JULY
653  JULY 
654  JULY  
655  JULY   
656  JULY    
657  JULY     
658  JULY      
659  JULY       
660  JULY        
661  JULY         
662  JULY          
663  JULY           
664  JULY            
665  JULY             
666  JULY              
667  JULY               
668  JULY                
669  JULY                 
670  JULY                  
671  JULY                   
672  JULY                    
673  JULY                     
674  JULY                      
675  JULY                       
676  JULY                        
677  JULY                         
678  JULY                          
679  JULY                           
680  JULY                            
681  JULY                             
682  JULY                              
683  JULY                               
684  JULY                                
685  JULY                                 
686  JULY                                  
687  JULY                                   
688  JULY                                    
689  JUL
690  JULY
691  JULY 
692  JULY  
693  JULY   
694  JULY    
695  JULY     
696  JULY      
697  JULY       
698  JULY        
699  JULY         
700  JULY          
701  JULY           
702  JULY            
703  JULY             
704  JULY              
705  JULY               
706  JULY                
707  JULY                 
708  JULY                  
709  JULY                   
710  JULY                    
711  JULY                     
712  JULY                      
713  JULY                       
714  JULY                        
715  JULY                         
716  JULY                          
717  JULY                           
718  JULY                            
719  JULY                             
720  JULY                              
721  JULY                               
722  JULY                                
723  JULY                                 
724  JULY                                  
725  JULY                                   
726  JULY                                    
727  JUL
728  JULY
729  JULY 
730  JULY  
731  JULY   
732  JULY    
733  JULY     
734  JULY      
735  JULY       
736  JULY        
737  JULY         
738  JULY          
739  JULY           
740  JULY            
741  JULY             
742  JULY              
743  JULY               
744  JULY                
745  JULY                 
746  JULY                  
747  JULY                   
748  JULY                    
749  JULY                     
750  JULY                      
751  JULY                       
752  JULY                        
753  JULY                         
754  JULY                          
755  JULY                           
756  JULY                            
757  JULY                             
758  JULY                              
759  JULY                               
760  JULY                                
761  JULY                                 
762  JULY                                  
763  JULY                                   
764  JULY                                    
765  AUG
766  AUGU
767  AUGUS
768  AUGUST
769  AUGUST 
770  AUGUST  
771  AUGUST   
772  AUGUST    
773  AUGUST     
774  AUGUST      
775  AUGUST       
776  AUGUST        
777  AUGUST         
778  AUGUST          
779  AUGUST           
780  AUGUST            
781  AUGUST             
782  AUGUST              
783  AUGUST               
784  AUGUST                
785  AUGUST                 
786  AUGUST                  
787  AUGUST                   
788  AUGUST                    
789  AUGUST                     
790  AUGUST                      
791  AUGUST                       
792  AUGUST                        
793  AUGUST                         
794  AUGUST                          
795  AUGUST                           
796  AUGUST                            
797  AUGUST                             
798  AUGUST                              
799  AUGUST                               
800  AUGUST                                
801  AUGUST                                 
802  AUGUST                                  
803  SEP
804  SEPT
805  SEPTE
806  SEPTEM
807  SEPTEMB
808  SEPTEMBE
809  SEPTEMBER
810  SEPTEMBER 
811  SEPTEMBER  
812  SEPTEMBER   
813  SEPTEMBER    
814  SEPTEMBER     
815  SEPTEMBER      
816  SEPTEMBER       
817  SEPTEMBER        
818  SEPTEMBER         
819  SEPTEMBER          
820  SEPTEMBER           
821  SEPTEMBER            
822  SEPTEMBER             
823  SEPTEMBER              
824  SEPTEMBER               
825  SEPTEMBER                
826  SEPTEMBER                 
827  SEPTEMBER                  
828  SEPTEMBER                   
829  SEPTEMBER                    
830  SEPTEMBER                     
831  SEPTEMBER                      
832  SEPTEMBER                       
833  SEPTEMBER                        
834  SEPTEMBER                         
835  SEPTEMBER                          
836  SEPTEMBER                           
837  SEPTEMBER                            
838  SEPTEMBER                             
839  SEPTEMBER                              
840  SEPTEMBER                               
841  OCT
842  OCTO
843  OCTOB
844  OCTOBE
845  OCTOBER
846  OCTOBER 
847  OCTOBER  
848  OCTOBER   
849  OCTOBER    
850  OCTOBER     
851  OCTOBER      
852  OCTOBER       
853  OCTOBER        
854  OCTOBER         
855  OCTOBER          
856  OCTOBER           
857  OCTOBER            
858  OCTOBER             
859  OCTOBER              
860  OCTOBER               
861  OCTOBER                
862  OCTOBER                 
863  OCTOBER                  
864  OCTOBER                   
865  OCTOBER                    
866  OCTOBER                     
867  OCTOBER                      
868  OCTOBER                       
869  OCTOBER                        
870  OCTOBER                         
871  OCTOBER                          
872  OCTOBER                           
873  OCTOBER                            
874  OCTOBER                             
875  OCTOBER                              
876  OCTOBER                               
877  OCTOBER                                
878  OCTOBER                                 
879  NOV
880  NOVE
881  NOVEM
882  NOVEMB
883  NOVEMBE
884  NOVEMBER
885  NOVEMBER 
886  NOVEMBER  
887  NOVEMBER   
888  NOVEMBER    
889  NOVEMBER     
890  NOVEMBER      
891  NOVEMBER       
892  NOVEMBER        
893  NOVEMBER         
894  NOVEMBER          
895  NOVEMBER           
896  NOVEMBER            
897  NOVEMBER             
898  NOVEMBER              
899  NOVEMBER               
900  NOVEMBER                
901  NOVEMBER                 
902  NOVEMBER                  
903  NOVEMBER                   
904  NOVEMBER                    
905  NOVEMBER                     
906  NOVEMBER                      
907  NOVEMBER                       
908  NOVEMBER                        
909  NOVEMBER                         
910  NOVEMBER                          
911  NOVEMBER                           
912  NOVEMBER                            
913  NOVEMBER                             
914  NOVEMBER                              
915  NOVEMBER                               
916  NOVEMBER                                
917  DEC
918  DECE
919  DECEM
920  DECEMB
921  DECEMBE
922  DECEMBER
923  DECEMBER 
924  DECEMBER  
925  DECEMBER   
926  DECEMBER    
927  DECEMBER     
928  DECEMBER      
929  DECEMBER       
930  DECEMBER        
931  DECEMBER         
932  DECEMBER          
933  DECEMBER           
934  DECEMBER            
935  DECEMBER             
936  DECEMBER              
937  DECEMBER               
938  DECEMBER                
939  DECEMBER                 
940  DECEMBER                  
941  DECEMBER                   
942  DECEMBER                    
943  DECEMBER                     
944  DECEMBER                      
945  DECEMBER                       
946  DECEMBER                        
947  DECEMBER                         
948  DECEMBER                          
949  DECEMBER                           
950  DECEMBER                            
951  DECEMBER                             
952  DECEMBER                              
953  DECEMBER                               
954  DECEMBER                                
955    .
956     .
957      .
958       .
959        .
960         .
961          .
962           .
963            .
964             .
965              .
966               .
967                .
968                 .
969                  .
970                   .
971                    .
972                     .
973                      .
974                       .
975                        .
976                         .
977                          .
978                           .
979                            .
980                             .
981                              .
982                               .
983                                .
984                                 .
985                                  .
986                                   .
987                                    .
988                                     .
989                                      .
990                                       .
991                                        .
992                                         .
993 EOF
994 if [ $? -ne 0 ] ; then fail ; fi
995
996 pass