Fix missing @clicksequence problem with older Texinfo versions.
[pspp-builds.git] / tests / command / no_case_size.sh
1 #!/bin/sh
2
3 # This program tests that system files can be read properly, even when the 
4 # case_size header value is -1 (Some 3rd party products do this)
5
6
7 TEMPDIR=/tmp/pspp-tst-$$
8 TESTFILE=$TEMPDIR/`basename $0`.sps
9
10 # ensure that top_builddir  are absolute
11 if [ -z "$top_builddir" ] ; then top_builddir=. ; fi
12 if [ -z "$top_srcdir" ] ; then top_srcdir=. ; fi
13 top_builddir=`cd $top_builddir; pwd`
14 PSPP=$top_builddir/src/ui/terminal/pspp
15
16 # ensure that top_srcdir is absolute
17 top_srcdir=`cd $top_srcdir; pwd`
18
19 STAT_CONFIG_PATH=$top_srcdir/config
20 export STAT_CONFIG_PATH
21
22
23 cleanup()
24 {
25      if [ x"$PSPP_TEST_NO_CLEANUP" != x ] ; then 
26         echo "NOT cleaning $TEMPDIR"
27         return ; 
28      fi
29      cd /
30      rm -rf $TEMPDIR
31 }
32
33
34 fail()
35 {
36     echo $activity
37     echo FAILED
38     cleanup;
39     exit 1;
40 }
41
42
43 no_result()
44 {
45     echo $activity
46     echo NO RESULT;
47     cleanup;
48     exit 2;
49 }
50
51 pass()
52 {
53     cleanup;
54     exit 0;
55 }
56
57 mkdir -p $TEMPDIR
58
59 cd $TEMPDIR
60
61 activity="create program"
62 cat <<EOF > $TESTFILE
63 GET FILE='$top_srcdir/tests/no_case_size.sav'.
64 DISPLAY DICTIONARY.
65 LIST.
66 EOF
67 if [ $? -ne 0 ] ; then no_result ; fi
68
69
70 activity="run program"
71 $SUPERVISOR $PSPP --testing-mode $TESTFILE
72 if [ $? -ne 0 ] ; then no_result ; fi
73
74 activity="compare output"
75 perl -pi -e 's/^\s*$//g' pspp.list
76 diff -b -w pspp.list - <<EOF
77 1.1 DISPLAY.  
78 +--------+-------------------------------------------+--------+
79 |Variable|Description                                |Position|
80 #========#===========================================#========#
81 |cont    |continents of the world                    |       1|
82 |        |Format: A32                                |        |
83 |        |Measure: Nominal                           |        |
84 |        |Display Alignment: Left                    |        |
85 |        |Display Width: 8                           |        |
86 +--------+-------------------------------------------+--------+
87 |size    |sq km                                      |       2|
88 |        |Format: F8.2                               |        |
89 |        |Measure: Nominal                           |        |
90 |        |Display Alignment: Left                    |        |
91 |        |Display Width: 8                           |        |
92 +--------+-------------------------------------------+--------+
93 |pop     |population                                 |       3|
94 |        |Format: F8.2                               |        |
95 |        |Measure: Nominal                           |        |
96 |        |Display Alignment: Left                    |        |
97 |        |Display Width: 8                           |        |
98 +--------+-------------------------------------------+--------+
99 |count   |number of countries                        |       4|
100 |        |Format: F8.2                               |        |
101 |        |Measure: Nominal                           |        |
102 |        |Display Alignment: Left                    |        |
103 |        |Display Width: 8                           |        |
104 +--------+-------------------------------------------+--------+
105                             cont     size      pop    count
106 -------------------------------- -------- -------- --------
107 Asia                             44579000 3.7E+009    44.00 
108 Africa                           30065000 7.8E+008    53.00 
109 North America                    24256000 4.8E+008    23.00 
110 South America                    17819000 3.4E+008    12.00 
111 Antarctica                       13209000      .00      .00 
112 Europe                            9938000 7.3E+008    46.00 
113 Australia/Oceania                 7687000 31000000    14.00 
114 EOF
115 if [ $? -ne 0 ] ; then fail ; fi
116
117
118 pass;