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$EXEEXT
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
24 if [ x"$PSPP_TEST_NO_CLEANUP" != x ] ; then
25 echo "NOT cleaning $TEMPDIR"
60 activity="Create File 1"
61 cat > paper-size.pspp <<EOF
63 debug paper size 'a4'.
64 debug paper size 'letter'.
65 debug paper size '10x14in'.
66 debug paper size '210x297mm'.
68 if [ $? -ne 0 ] ; then no_result ; fi
71 PAPERSIZE=letter $SUPERVISOR $PSPP --testing-mode -o pspp.csv paper-size.pspp > paper-size.out
72 if [ $? -ne 0 ] ; then no_result ; fi
74 activity="compare results"
75 diff -b $TEMPDIR/paper-size.out - <<EOF
76 "" => 8.5 x 11.0 in, 216 x 279 mm
77 "a4" => 8.3 x 11.7 in, 210 x 297 mm
78 "letter" => 8.5 x 11.0 in, 216 x 279 mm
79 "10x14in" => 10.0 x 14.0 in, 254 x 356 mm
80 "210x297mm" => 8.3 x 11.7 in, 210 x 297 mm
82 if [ $? -ne 0 ] ; then fail ; fi
84 activity="Create File 2"
85 cat > paper-size-2.pspp <<EOF
88 if [ $? -ne 0 ] ; then no_result ; fi
91 PAPERSIZE=a4 $SUPERVISOR $PSPP --testing-mode -o pspp.csv paper-size-2.pspp > paper-size-2.out
92 if [ $? -ne 0 ] ; then no_result ; fi
94 activity="compare results 2"
95 diff -b $TEMPDIR/paper-size-2.out - <<EOF
96 "" => 8.3 x 11.7 in, 210 x 297 mm
98 if [ $? -ne 0 ] ; then fail ; fi