${no-attributes}
list-ascii:ascii:listing:length=66 width=79 char-set=ascii \
output-file=${list-output-file} ${no-attributes}
+raw-ascii:ascii:screen:char-set=ascii \
+ output-file=${list-output-file} ${no-attributes} headers=off paginate=off
# ASCII devices that support bold & underline via backspacing.
tty-ascii-bi:ascii:screen:char-set=ascii output-file=${tty-output-file}
cp += nl_len;
}
memcpy (cp, ls_value (&x->ops[OPS_FORMFEED]), ff_len);
- output_string (this, s, &s[total_len]);
+ if ( x->paginate )
+ output_string (this, s, &s[total_len]);
if (line_p != line_buf && !commit_line_buf (this))
return 0;
where.filename = pprsz_fn;
where.line_number = 0;
err_push_file_locator (&where);
+ ds_init (NULL, &line, 128);
if (pprsz_fn == NULL)
{
goto exit;
}
- ds_init (NULL, &line, 128);
for (;;)
{
char *cp, *bp, *ep;
make BENCHMARK=1 check
TESTS_ENVIRONMENT=top_srcdir=${top_srcdir}
-TESTS = syntax bugs/double-frequency.sh bugs/html-frequency.sh
+TESTS = command/aggregate.sh \
+ command/autorecod.sh \
+ command/beg-data.sh \
+ bugs/double-frequency.sh \
+ bugs/html-frequency.sh
noinst_PROGRAMS = gengarbage
sort.data: gengarbage
./gengarbage | head -1000 > $@
-EXTRA_DIST = aggregate.stat autorecod.stat beg-data.stat bignum.data \
+EXTRA_DIST = bignum.data \
bignum.stat compute.stat count.stat crosstabs.stat data-fmts.stat \
data-list.data data-list.stat descript.stat do-if.stat do-repeat.stat \
expr.stat file-lab.stat filter.stat flip.stat gengarbage.c \
+++ /dev/null
-title 'Test for AGGREGATE procedure'.
-
-data list /x y 1-2.
-begin data.
-13
-27
-30
-12
-26
-11
-10
-28
-29
-14
-15
-end data.
-sort cases by x.
-list.
-aggregate outfile='aggregate.save'/missing=columnwise /document /presorted/break=x(a) /z'label for z'=sum(y)/foo=nu.
-list.
+++ /dev/null
-title 'Test for AUTORECODE procedure'.
-
-/* Tries AUTORECODE on some random but similar strings of characters.
-data list /x 1-5(a) y 7.
-begin data.
-lasdj 1 1 3
-asdfk 0 3 <---- These are the numbers that should be produced for a 4
-asdfj 2 4 2
-asdfj 1 4 3
-asdfk 2 3 2
-asdfj 9 4 1
-lajks 9 2 1
-asdfk 0 3 These are the numbers that should be produced for b ----> 4
-asdfk 1 3 3
-end data.
-list.
-autorecode x y into a b/descend.
-
-/* This should produce the values indicated in the data above.
-list.
-
-/* Just to make sure it works on second & subsequent executions,
-/* try it again.
-compute z=trunc(y/2).
-autorecode z into w.
-
-/* This should display:
-/* z 0 0 1 0 1 4 4 0 0
-/* w 1 1 2 1 2 3 3 1 1
-list z w.
+++ /dev/null
-title 'Test BEGIN DATA ... END DATA'.
-
-remark EOF
-----------------------------------------------------------------------
-First we show that we can input data with BEGIN DATA/END DATA after
-a procedure.
-----------------------------------------------------------------------
-EOF
-data list /A B 1-2.
-list.
-begin data.
-12
-34
-56
-78
-90
-end data.
-
-remark EOF
-----------------------------------------------------------------------
-Next we show that BEGIN DATA/END DATA work fine on their own as well.
-----------------------------------------------------------------------
-EOF
-data list /A B 1-2.
-begin data.
-09
-87
-65
-43
-21
-end data.
-list.
TEMPDIR=/tmp/pspp-tst-$$
+here=`pwd`;
+
+# ensure that top_srcdir is absolute
+cd $top_srcdir; top_srcdir=`pwd`
+
+
+export STAT_CONFIG_PATH=$top_srcdir/config
+
+
cleanup()
{
rm -rf $TEMPDIR
mkdir -p $TEMPDIR
-here=`pwd`;
activity="create data"
cat << EOF > $TEMPDIR/ff.stat
EOF
if [ $? -ne 0 ] ; then no_result ; fi
-cd $top_srcdir; top_srcdir=`pwd`
cd $TEMPDIR
activity="run data"
-$here/../src/pspp -B $top_srcdir/config $TEMPDIR/ff.stat
+$here/../src/pspp $TEMPDIR/ff.stat
if [ $? -ne 0 ] ; then fail ; fi
TEMPDIR=/tmp/pspp-tst-$$
+here=`pwd`
+
+# ensure that top_srcdir is absolute
+cd $top_srcdir ; top_srcdir=`pwd`
+
+STAT_CONFIG_PATH=$top_srcdir/config
+
cleanup()
{
rm -rf $TEMPDIR
mkdir -p $TEMPDIR
-here=`pwd`;
activity="create data"
cat << EOF > $TEMPDIR/ff.stat
EOF
if [ $? -ne 0 ] ; then no_result ; fi
-cd $top_srcdir ; top_srcdir=`pwd`
cd $TEMPDIR
activity="run data"
-$here/../src/pspp -B $top_srcdir/config -o html $TEMPDIR/ff.stat
+$here/../src/pspp -o html $TEMPDIR/ff.stat
if [ $? -ne 0 ] ; then fail ; fi
--- /dev/null
+#!/bin/sh
+
+# This program tests the aggregate procedure
+
+TEMPDIR=/tmp/pspp-tst-$$
+
+here=`pwd`;
+
+# ensure that top_srcdir is absolute
+cd $top_srcdir; top_srcdir=`pwd`
+
+export STAT_CONFIG_PATH=$top_srcdir/config
+
+cleanup()
+{
+ rm -rf $TEMPDIR
+}
+
+
+fail()
+{
+ echo $activity
+ echo FAILED
+ cleanup;
+ exit 1;
+}
+
+
+no_result()
+{
+ echo $activity
+ echo NO RESULT;
+ cleanup;
+ exit 2;
+}
+
+pass()
+{
+ cleanup;
+ exit 0;
+}
+
+mkdir -p $TEMPDIR
+
+cd $TEMPDIR
+
+activity="program create"
+cat > $TEMPDIR/test.sps << EOF
+
+data list notable /x y 1-2.
+begin data.
+13
+27
+30
+12
+26
+11
+10
+28
+29
+14
+15
+end data.
+sort cases by x.
+aggregate /missing=columnwise /document /presorted/break=x(a) /z'label for z'=sum(y)/foo=nu.
+list.
+EOF
+if [ $? -ne 0 ] ; then no_result ; fi
+
+activity="run program"
+$here/../src/pspp -o raw-ascii $TEMPDIR/test.sps
+if [ $? -ne 0 ] ; then no_result ; fi
+
+
+activity="test result"
+diff -B $TEMPDIR/pspp.list - << EOF
+X Z FOO
+- -------- --------
+1 15.00 6.00
+2 30.00 4.00
+3 .00 1.00
+EOF
+if [ $? -ne 0 ] ; then fail ; fi
+
+pass;
--- /dev/null
+#!/bin/sh
+
+# This program tests the autorecode command
+
+TEMPDIR=/tmp/pspp-tst-$$
+
+here=`pwd`;
+
+# ensure that top_srcdir is absolute
+cd $top_srcdir; top_srcdir=`pwd`
+
+export STAT_CONFIG_PATH=$top_srcdir/config
+
+
+cleanup()
+{
+ rm -rf $TEMPDIR
+}
+
+
+fail()
+{
+ echo $activity
+ echo FAILED
+ cleanup;
+ exit 1;
+}
+
+
+no_result()
+{
+ echo $activity
+ echo NO RESULT;
+ cleanup;
+ exit 2;
+}
+
+pass()
+{
+ cleanup;
+ exit 0;
+}
+
+mkdir -p $TEMPDIR
+
+cd $TEMPDIR
+
+activity="create program"
+cat > $TEMPDIR/prog.sps <<EOF
+/* Tries AUTORECODE on some random but similar strings of characters.
+data list /x 1-5(a) y 7.
+begin data.
+lasdj 1 1 3
+asdfk 0 3 <---- These are the numbers that should be produced for a 4
+asdfj 2 4 2
+asdfj 1 4 3
+asdfk 2 3 2
+asdfj 9 4 1
+lajks 9 2 1
+asdfk 0 3 These are the numbers that should be produced for b ----> 4
+asdfk 1 3 3
+end data.
+
+autorecode x y into a b/descend.
+
+list.
+/* Just to make sure it works on second & subsequent executions,
+/* try it again.
+compute z=trunc(y/2).
+autorecode z into w.
+list.
+EOF
+if [ $? -ne 0 ] ; then no_result ; fi
+
+activity="run program"
+$here/../src/pspp -o raw-ascii $TEMPDIR/prog.sps
+if [ $? -ne 0 ] ; then no_result ; fi
+
+activity="test output"
+diff -B $TEMPDIR/pspp.list - <<EOF
+1.1 DATA LIST. Reading 1 record from the command file.
++--------+------+-------+------+
+|Variable|Record|Columns|Format|
+#========#======#=======#======#
+|X | 1| 1- 5|A5 |
+|Y | 1| 7- 7|F1.0 |
++--------+------+-------+------+
+
+ X Y A B
+----- - -------- --------
+lasdj 1 1.00 3.00
+asdfk 0 3.00 4.00
+asdfj 2 4.00 2.00
+asdfj 1 4.00 3.00
+asdfk 2 3.00 2.00
+asdfj 9 4.00 1.00
+lajks 9 2.00 1.00
+asdfk 0 3.00 4.00
+asdfk 1 3.00 3.00
+
+ X Y A B Z W
+----- - -------- -------- -------- --------
+lasdj 1 1.00 3.00 .00 1.00
+asdfk 0 3.00 4.00 .00 1.00
+asdfj 2 4.00 2.00 1.00 2.00
+asdfj 1 4.00 3.00 .00 1.00
+asdfk 2 3.00 2.00 1.00 2.00
+asdfj 9 4.00 1.00 4.00 3.00
+lajks 9 2.00 1.00 4.00 3.00
+asdfk 0 3.00 4.00 .00 1.00
+asdfk 1 3.00 3.00 .00 1.00
+EOF
+if [ $? -ne 0 ] ; then fail ; fi
+
+pass
+
+
+
--- /dev/null
+#!/bin/sh
+
+# This program tests the BEGIN DATA / END DATA commands
+
+TEMPDIR=/tmp/pspp-tst-$$
+
+here=`pwd`;
+
+# ensure that top_srcdir is absolute
+cd $top_srcdir; top_srcdir=`pwd`
+
+export STAT_CONFIG_PATH=$top_srcdir/config
+
+
+cleanup()
+{
+ rm -rf $TEMPDIR
+}
+
+
+fail()
+{
+ echo $activity
+ echo FAILED
+ cleanup;
+ exit 1;
+}
+
+
+no_result()
+{
+ echo $activity
+ echo NO RESULT;
+ cleanup;
+ exit 2;
+}
+
+pass()
+{
+ cleanup;
+ exit 0;
+}
+
+mkdir -p $TEMPDIR
+
+cd $TEMPDIR
+
+activity="create program"
+cat > $TEMPDIR/prog.sps << EOF_foobar
+title 'Test BEGIN DATA ... END DATA'.
+
+remark EOF
+----------------------------------------------------------------------
+First we show that we can input data with BEGIN DATA/END DATA after
+a procedure.
+----------------------------------------------------------------------
+EOF
+data list /A B 1-2.
+list.
+begin data.
+12
+34
+56
+78
+90
+end data.
+
+remark EOF
+----------------------------------------------------------------------
+Next we show that BEGIN DATA/END DATA work fine on their own as well.
+----------------------------------------------------------------------
+EOF
+data list /A B 1-2.
+begin data.
+09
+87
+65
+43
+21
+end data.
+list.
+EOF_foobar
+if [ $? -ne 0 ] ; then no_result ; fi
+
+
+activity="run program"
+$here/../src/pspp -o raw-ascii $TEMPDIR/prog.sps
+if [ $? -ne 0 ] ; then no_result ; fi
+
+activity="compare data"
+diff -B $TEMPDIR/pspp.list - << foobar
+----------------------------------------------------------------------
+First we show that we can input data with BEGIN DATA/END DATA after
+a procedure.
+----------------------------------------------------------------------
+
+1.1 DATA LIST. Reading 1 record from the command file.
++--------+------+-------+------+
+|Variable|Record|Columns|Format|
+#========#======#=======#======#
+|A | 1| 1- 1|F1.0 |
+|B | 1| 2- 2|F1.0 |
++--------+------+-------+------+
+
+A B
+- -
+1 2
+3 4
+5 6
+7 8
+9 0
+
+----------------------------------------------------------------------
+Next we show that BEGIN DATA/END DATA work fine on their own as well.
+----------------------------------------------------------------------
+
+2.1 DATA LIST. Reading 1 record from the command file.
++--------+------+-------+------+
+|Variable|Record|Columns|Format|
+#========#======#=======#======#
+|A | 1| 1- 1|F1.0 |
+|B | 1| 2- 2|F1.0 |
++--------+------+-------+------+
+
+A B
+- -
+0 9
+8 7
+6 5
+4 3
+2 1
+foobar
+if [ $? -ne 0 ] ; then fail ; fi
+
+
+pass;
+++ /dev/null
-#!/bin/sh
-
-build_dir=`pwd`
-
-
-# This script tests that incorrect syntax on various commands produces the
-# appropriate error messages
-
-set -e
-RESULT=pass
-
-
-#for x in `cd $srcdir; echo *.stat *.data`; do
-# if [ ! -e $x ]; then
-# ln -s $srcdir/$x .
-# fi
-#done
-
-rm -f *.actual
-if [ -z "$BENCHMARK" ]; then
- for t in $top_srcdir/tests/*.stat; do
- x=`basename $t`
- echo -n "$x ... "
-# if [ $x = bignum.stat ] ; then continue ; fi
-# if [ $x = data-list.stat ] ; then continue ; fi
-# if [ $x = do-repeat.stat ] ; then continue ; fi
-# if [ $x = list.stat ] ; then continue ; fi
-# if [ $x = print.stat ] ; then continue ; fi
-# if [ $x = reread.stat ] ; then continue ; fi
-# if [ $x = weighting.stat ] ; then continue ; fi
- cat $t | ../src/pspp -B $top_srcdir/config --testing-mode - > $build_dir/$x.actual
- if [ -f $top_srcdir/tests/expect/$x ]; then
- if diff -u $top_srcdir/tests/expect/$x $build_dir/$x.actual; then
- echo "pass"; rm $build_dir/$x.actual
- else
- echo "FAIL"; RESULT=fail ; exit 1
- fi
- else
- if [ -s $build_dir/$x.actual ]; then
- diff -u /dev/null $build_dir/$x.actual || true
- echo "FAIL"; RESULT=fail ; exit 1
- else
- echo "pass"; rm $build_dir/$x.actual
- fi
- fi
- done
-else
- mkdir $build_dir/benchmark || true
- rm -f $build_dir/benchmark/*
- for x in $top_srcdir/tests/*.stat; do
- echo -n "$x ... "
- ../src/pspp -B $top_srcdir/config --testing-mode $x > $build_dir/benchmark/$x
- if [ ! -s $build_dirbenchmark/$x ]; then
- rm $build_dir/benchmark/$x
- fi
- echo
- done
-fi
-
-# for x in *.stat *.data; do
-# if [ -h $x ]; then
-# rm $x
-# fi
-#done
-
-if [ $RESULT = fail ]; then exit 1; fi
-
--- /dev/null
+#!/bin/sh
+
+# This program tests ....
+
+TEMPDIR=/tmp/pspp-tst-$$
+
+here=`pwd`;
+
+# ensure that top_srcdir is absolute
+cd $top_srcdir; top_srcdir=`pwd`
+
+export STAT_CONFIG_PATH=$top_srcdir/config
+
+
+cleanup()
+{
+ rm -rf $TEMPDIR
+}
+
+
+fail()
+{
+ echo $activity
+ echo FAILED
+ cleanup;
+ exit 1;
+}
+
+
+no_result()
+{
+ echo $activity
+ echo NO RESULT;
+ cleanup;
+ exit 2;
+}
+
+pass()
+{
+ cleanup;
+ exit 0;
+}
+
+mkdir -p $TEMPDIR
+
+cd $TEMPDIR
+
+put test set up here ...
+
+if [ $? -ne 0 ] ; then no_result ; fi
+
+
+put test here
+
+if [ $? -ne 0 ] ; then fail ; fi
+
+
+pass;