3 # This program tests paper size support.
5 TEMPDIR=/tmp/pspp-tst-$$
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
13 # ensure that top_srcdir is absolute
14 top_srcdir=`cd $top_srcdir; pwd`
16 STAT_CONFIG_PATH=$top_srcdir/config
17 export STAT_CONFIG_PATH
56 activity="Create File 1"
57 cat > paper-size.pspp <<EOF
59 debug paper size 'a4'.
60 debug paper size 'letter'.
61 debug paper size '10x14in'.
62 debug paper size '210x297mm'.
64 if [ $? -ne 0 ] ; then no_result ; fi
67 PAPERSIZE=letter $SUPERVISOR $PSPP --testing-mode paper-size.pspp > paper-size.out
68 if [ $? -ne 0 ] ; then no_result ; fi
70 activity="compare results"
71 diff -b $TEMPDIR/paper-size.out - <<EOF
72 "" => 8.5 x 11.0 in, 216 x 279 mm
73 "a4" => 8.3 x 11.7 in, 210 x 297 mm
74 "letter" => 8.5 x 11.0 in, 216 x 279 mm
75 "10x14in" => 10.0 x 14.0 in, 254 x 356 mm
76 "210x297mm" => 8.3 x 11.7 in, 210 x 297 mm
78 if [ $? -ne 0 ] ; then fail ; fi
80 activity="Create File 2"
81 cat > paper-size-2.pspp <<EOF
84 if [ $? -ne 0 ] ; then no_result ; fi
87 PAPERSIZE=a4 $SUPERVISOR $PSPP --testing-mode paper-size-2.pspp > paper-size-2.out
88 if [ $? -ne 0 ] ; then no_result ; fi
90 activity="compare results 2"
91 diff -b $TEMPDIR/paper-size-2.out - <<EOF
92 "" => 8.3 x 11.7 in, 210 x 297 mm
94 if [ $? -ne 0 ] ; then fail ; fi