+
+for outfile in scratch active external; do
+ for sort in presorted unsorted; do
+ for missing in itemwise columnwise; do
+ name=$outfile-$sort-$missing
+
+ activity="create $name.pspp"
+ {
+ echo "data list notable file='aggregate.data' /G N 1-2 S 3(a) W 4."
+ echo "weight by w."
+ echo "missing values n(4) s('4')."
+ if [ "$sort" = "presorted" ]; then
+ echo "sort cases by g."
+ fi
+ echo "aggregate"
+ if [ "$outfile" = "active" ]; then
+ echo " outfile=*"
+ elif [ "$outfile" = "external" ]; then
+ echo " outfile='aggregate.sys'"
+ else
+ echo " outfile=#AGGREGATE"
+ fi
+ if [ "$sort" = "presorted" ]; then
+ echo " /presorted"
+ fi
+ if [ "$missing" = "columnwise" ]; then
+ echo " /missing=columnwise"
+ fi
+ cat agg-skel.pspp
+ if [ "$outfile" = "external" ]; then
+ echo "get file='aggregate.sys'."
+ elif [ "$outfile" = "scratch" ]; then
+ echo "get file=#AGGREGATE."
+ fi
+ echo "list."
+ } > $name.pspp
+ if [ $? -ne 0 ] ; then no_result ; fi
+
+ activity="run $name.pspp"
+ $SUPERVISOR $PSPP --testing-mode -o raw-ascii -e /dev/null $name.pspp
+ if [ $? -ne 0 ] ; then no_result ; fi
+
+ activity="check $name output"
+ perl -pi -e 's/^\s*$//g' pspp.list agg-$missing.out
+ diff -b -w pspp.list agg-$missing.out
+ if [ $? -ne 0 ] ; then fail ; fi
+ done
+ done
+done