Add scratch file handles.
[pspp-builds.git] / tests / command / aggregate.sh
index c6f48ae913e30f49604296441f2ffc239fcb8f77..a751f9dc6a26fd04276a1a2206b1a02dc0ae2664 100755 (executable)
@@ -17,6 +17,7 @@ export STAT_CONFIG_PATH
 
 cleanup()
 {
+     cd /
      rm -rf $TEMPDIR
 }
 
@@ -165,7 +166,7 @@ G        N       NI      NU     NUI NFGT2 NFGT2I SFGT2 SFGT2I NFIN23 NFIN23I SFI
 4     1.00     1.00       1       1  .      .     .     1.000   .       .      .       .000  .      .     .      .000      .       .              4    .        .       .       1.000     .      .            4    .     .          4      .        .      .     .          4      .00      .00      .00     1.00     1.00     1.00     1.00      .00       0       0       0       1       1        1       1        0    .      .     .   100.0     .       .      .       .0    .      .     .      .0      .        .       .     100.0      .        .        .        .   
 EOF
 
-for outfile in active external; do
+for outfile in temporary active external; do
     for sort in presorted unsorted; do
        for missing in itemwise columnwise; do
            name=$outfile-$sort-$missing
@@ -181,8 +182,10 @@ for outfile in active external; do
                echo "aggregate"
                if [ "$outfile" = "active" ]; then
                    echo "      outfile=*"
-               else
+               elif [ "$outfile" = "external" ]; then
                    echo "      outfile='aggregate.sys'"
+               else
+                   echo "      outfile=#AGGREGATE"
                fi
                if [ "$sort" = "presorted" ]; then
                    echo "      /presorted"
@@ -193,6 +196,8 @@ for outfile in active external; do
                cat agg-skel.pspp
                if [ "$outfile" = "external" ]; then
                    echo "get file='aggregate.sys'."
+               elif [ "$outfile" = "temporary" ]; then
+                   echo "get file=#AGGREGATE."
                fi
                echo "list."
            } > $name.pspp
@@ -203,7 +208,8 @@ for outfile in active external; do
            if [ $? -ne 0 ] ; then no_result ; fi
 
            activity="check $name output"
-           diff -b -w -B pspp.list agg-$missing.out
+           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