From b08603f631a2d998d8c604692fdf13669bb5e510 Mon Sep 17 00:00:00 2001 From: Jason Stover Date: Mon, 10 Oct 2005 22:18:06 +0000 Subject: [PATCH] Made BSD diff compatible --- tests/bugs/agg-crash-2.sh | 3 ++- tests/bugs/compute-lv.sh | 3 ++- tests/bugs/computebug.out | 2 -- tests/bugs/computebug.sh | 3 ++- tests/bugs/crosstabs-crash.sh | 3 ++- tests/bugs/get.sh | 3 ++- tests/bugs/match-files-scratch.sh | 3 ++- tests/bugs/multipass.sh | 3 ++- tests/bugs/random.sh | 3 ++- tests/bugs/recode-copy-bug-1.out | 2 -- tests/bugs/recode-copy-bug-2.out | 2 -- tests/bugs/recode-copy-bug.sh | 6 ++++-- tests/bugs/t-test-alpha.sh | 3 ++- tests/bugs/t-test-with-temp.sh | 3 ++- tests/bugs/temp-freq.sh | 3 ++- tests/bugs/temporary.sh | 3 ++- tests/command/aggregate.sh | 3 ++- tests/command/beg-data.sh | 3 ++- tests/command/sample.sh | 3 ++- tests/command/sort.sh | 5 +++-- tests/command/sysfile-info.sh | 3 ++- tests/command/sysfiles-old.sh | 2 +- tests/command/sysfiles.sh | 2 +- tests/expressions/epoch.sh | 3 ++- tests/expressions/expressions.sh | 6 ++++-- tests/expressions/randist.sh | 3 ++- tests/expressions/variables.sh | 3 ++- tests/expressions/vectors.sh | 3 ++- tests/stats/descript-basic.sh | 3 ++- tests/stats/descript-mean-bug.sh | 3 ++- tests/stats/descript-missing.sh | 3 ++- tests/stats/moments.sh | 6 ++++-- tests/stats/percentiles-compatible.sh | 3 ++- tests/stats/percentiles-enhanced.sh | 12 ++++++++---- tests/xforms/casefile.sh | 3 ++- tests/xforms/expressions.sh | 3 ++- 36 files changed, 77 insertions(+), 46 deletions(-) diff --git a/tests/bugs/agg-crash-2.sh b/tests/bugs/agg-crash-2.sh index cd2fd1e3..9bec5da2 100755 --- a/tests/bugs/agg-crash-2.sh +++ b/tests/bugs/agg-crash-2.sh @@ -69,7 +69,8 @@ if [ $? -ne 0 ] ; then no_result ; fi $SUPERVISOR $here/../src/pspp -o raw-ascii $TESTFILE if [ $? -ne 0 ] ; then no_result ; fi -diff -b -B -w $TEMPDIR/pspp.list - << EOF +perl -pi -e s/^\s*\$//g $TEMPDIR/pspp.list +diff -b -w $TEMPDIR/pspp.list - << EOF | perl -e 's/^\s*$//g' 1.1 DATA LIST. Reading free-form data from the command file. +--------+------+ |Variable|Format| diff --git a/tests/bugs/compute-lv.sh b/tests/bugs/compute-lv.sh index 2be6b021..c1b4fec5 100755 --- a/tests/bugs/compute-lv.sh +++ b/tests/bugs/compute-lv.sh @@ -71,7 +71,8 @@ if [ $? -ne 0 ] ; then fail ; fi activity="compare output" -diff -B -b pspp.list - << EOF +perl -pi -e 's/^\s*$//g' pspp.list +diff -b pspp.list - << EOF |perl -e 's/^\s*$//g' 1.1 DATA LIST. Reading free-form data from the command file. +----------------+------+ | Variable |Format| diff --git a/tests/bugs/computebug.out b/tests/bugs/computebug.out index 59d93d06..73640d46 100644 --- a/tests/bugs/computebug.out +++ b/tests/bugs/computebug.out @@ -5,9 +5,7 @@ |A |A161 | |B |A3 | +--------+------+ - A B ----------------------------------------------------------------------------------------------------------------------------------------------------------------- --- ABC def GHI jkl - diff --git a/tests/bugs/computebug.sh b/tests/bugs/computebug.sh index e29fa29c..af19f82b 100755 --- a/tests/bugs/computebug.sh +++ b/tests/bugs/computebug.sh @@ -61,7 +61,8 @@ if [ $? -ne 0 ] ; then no_result ; fi activity="compare output" -diff -b -B -w $TEMPDIR/pspp.list $top_srcdir/tests/bugs/computebug.out +perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list $top_srcdir/tests/bugs/computebug.out +diff -b -w $TEMPDIR/pspp.list $top_srcdir/tests/bugs/computebug.out if [ $? -ne 0 ] ; then fail ; fi pass; diff --git a/tests/bugs/crosstabs-crash.sh b/tests/bugs/crosstabs-crash.sh index f77ce50b..82030df5 100755 --- a/tests/bugs/crosstabs-crash.sh +++ b/tests/bugs/crosstabs-crash.sh @@ -64,7 +64,8 @@ $SUPERVISOR $here/../src/pspp -o raw-ascii $TESTFILE if [ $? -ne 0 ] ; then no_result ; fi -diff -b -B -w $TEMPDIR/pspp.list - << EOF +perl -pi -e s/^\s*\$//g $TEMPDIR/pspp.list +diff -b -w $TEMPDIR/pspp.list - << EOF | perl -e 's/^\s*$//g' 1.1 DATA LIST. Reading free-form data from the command file. +--------+------+ |Variable|Format| diff --git a/tests/bugs/get.sh b/tests/bugs/get.sh index 4fddea75..cd37b4a0 100755 --- a/tests/bugs/get.sh +++ b/tests/bugs/get.sh @@ -86,7 +86,8 @@ if [ $? -ne 0 ] ; then no_result ; fi activity="compare output" -diff -b -B -w $TEMPDIR/pspp.list - << EOF +perl -pi -e s/^\s*\$//g $TEMPDIR/pspp.list +diff -b -w $TEMPDIR/pspp.list - << EOF | perl -e 's/^\s*$//g' LOCATION EDITOR SHELL FREQ -------- -------- -------- -------- 1.00 1.00 1.00 2.00 diff --git a/tests/bugs/match-files-scratch.sh b/tests/bugs/match-files-scratch.sh index ce562c75..66a3ea3e 100755 --- a/tests/bugs/match-files-scratch.sh +++ b/tests/bugs/match-files-scratch.sh @@ -74,7 +74,8 @@ $SUPERVISOR $here/../src/pspp -o raw-ascii $TESTFILE if [ $? -ne 0 ] ; then no_result ; fi -diff -b -B -w $TEMPDIR/pspp.list - << EOF +perl -pi -e s/^\s*\$//g $TEMPDIR/pspp.list +diff -b -w $TEMPDIR/pspp.list - << EOF | perl -e 's/^\s*$//g' 1.1 DATA LIST. Reading free-form data from the command file. +--------+------+ |Variable|Format| diff --git a/tests/bugs/multipass.sh b/tests/bugs/multipass.sh index 524b7160..b88d62a1 100755 --- a/tests/bugs/multipass.sh +++ b/tests/bugs/multipass.sh @@ -74,7 +74,8 @@ $SUPERVISOR $here/../src/pspp -o raw-ascii $TESTFILE if [ $? -ne 0 ] ; then no_result ; fi -diff -b -B -w $TEMPDIR/pspp.list - << EOF +perl -pi -e s/^\s*\$//g $TEMPDIR/pspp.list +diff -b -w $TEMPDIR/pspp.list - << EOF | perl -e 's/^\s*$//g' 1.1 DATA LIST. Reading free-form data from the command file. +--------+------+ |Variable|Format| diff --git a/tests/bugs/random.sh b/tests/bugs/random.sh index 659b6935..ae4d4774 100755 --- a/tests/bugs/random.sh +++ b/tests/bugs/random.sh @@ -72,7 +72,8 @@ if [ $? -ne 0 ] ; then no_result ; fi activity="compare output" -diff -b -B -w $TEMPDIR/pspp.list - << EOF +perl -pi -e s/^\s*\$//g $TEMPDIR/pspp.list +diff -b -w $TEMPDIR/pspp.list - << EOF | perl -e 's/^\s*$//g' R1 -------- 7.71 diff --git a/tests/bugs/recode-copy-bug-1.out b/tests/bugs/recode-copy-bug-1.out index 961a79bd..47113b9b 100644 --- a/tests/bugs/recode-copy-bug-1.out +++ b/tests/bugs/recode-copy-bug-1.out @@ -5,10 +5,8 @@ |A |A1 | |B |A1 | +--------+------+ - A B - - 3 2 2 3 1 4 - diff --git a/tests/bugs/recode-copy-bug-2.out b/tests/bugs/recode-copy-bug-2.out index af6810fb..88674322 100644 --- a/tests/bugs/recode-copy-bug-2.out +++ b/tests/bugs/recode-copy-bug-2.out @@ -5,10 +5,8 @@ |A |A1 | |B |A1 | +--------+------+ - A B A1 - - -- 1 2 3 2 3 2 3 4 1 - diff --git a/tests/bugs/recode-copy-bug.sh b/tests/bugs/recode-copy-bug.sh index 1959831e..aec41a1d 100755 --- a/tests/bugs/recode-copy-bug.sh +++ b/tests/bugs/recode-copy-bug.sh @@ -65,7 +65,8 @@ if [ $? -ne 0 ] ; then no_result ; fi activity="compare output" -diff -b -B -w $TEMPDIR/pspp.list $top_srcdir/tests/bugs/recode-copy-bug-1.out +perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list $top_srcdir/tests/bugs/recode-copy-bug-1.out +diff -b -w $TEMPDIR/pspp.list $top_srcdir/tests/bugs/recode-copy-bug-1.out if [ $? -ne 0 ] ; then fail ; fi @@ -75,7 +76,8 @@ if [ $? -ne 0 ] ; then no_result ; fi activity="compare output" -diff -b -B -w $TEMPDIR/pspp.list $top_srcdir/tests/bugs/recode-copy-bug-2.out +perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list $top_srcdir/tests/bugs/recode-copy-bug-2.out +diff -b -w $TEMPDIR/pspp.list $top_srcdir/tests/bugs/recode-copy-bug-2.out if [ $? -ne 0 ] ; then fail ; fi pass; diff --git a/tests/bugs/t-test-alpha.sh b/tests/bugs/t-test-alpha.sh index befc9eb9..6b561054 100755 --- a/tests/bugs/t-test-alpha.sh +++ b/tests/bugs/t-test-alpha.sh @@ -78,7 +78,8 @@ $SUPERVISOR $here/../src/pspp -o raw-ascii $TESTFILE if [ $? -ne 0 ] ; then no_result ; fi activity="compare output" -diff -B -b $TEMPDIR/pspp.list - < $TEMPDIR/out-filtered if [ $? -ne 0 ] ; then no_result ; fi activity="compare output" -diff -b -B -w $TEMPDIR/out-filtered - << EOF +perl -pi -e 's/^\s*$//g' $TEMPDIR/out-filtered +diff -b -w $TEMPDIR/out-filtered - << EOF |perl -e 's/^\s*$//g' 1.1 DATA LIST. Reading free-form data from the command file. +--------+------+ |Variable|Format| diff --git a/tests/command/sysfiles-old.sh b/tests/command/sysfiles-old.sh index 0931a0af..c1cc5ea9 100755 --- a/tests/command/sysfiles-old.sh +++ b/tests/command/sysfiles-old.sh @@ -89,7 +89,7 @@ grep 'X=X' $TEMPDIR/foo.sav if [ $? -eq 0 ] ; then fail ; fi activity="compare output" -perl -pi -e s/^\s*\$//g $TEMPDIR/pspp.list +perl -pi -e 's/^\s*\$//g' $TEMPDIR/pspp.list diff -b -w $TEMPDIR/pspp.list - << EOF | perl -e 's/^\s*$//g' X VARIABLE VARIAB_A VARIAB_B -------- -------- -------- -------- diff --git a/tests/command/sysfiles.sh b/tests/command/sysfiles.sh index 0dd6c5fe..4dca4eaa 100755 --- a/tests/command/sysfiles.sh +++ b/tests/command/sysfiles.sh @@ -79,7 +79,7 @@ $SUPERVISOR $here/../src/pspp -o raw-ascii $TESTFILE if [ $? -ne 0 ] ; then no_result ; fi activity="compare output" -perl -pi -e s/^\s*\$//g $TEMPDIR/pspp.list +perl -pi -e 's/^\s*\$//g' $TEMPDIR/pspp.list diff -b -w $TEMPDIR/pspp.list - << EOF | perl -e 's/^\s*$//g' variable001 variable002 variable003 variable004 ----------- ----------- ----------- ----------- diff --git a/tests/expressions/epoch.sh b/tests/expressions/epoch.sh index 914de328..245322ac 100755 --- a/tests/expressions/epoch.sh +++ b/tests/expressions/epoch.sh @@ -138,7 +138,8 @@ activity="run program" $SUPERVISOR $here/../src/pspp --testing-mode $TEMPDIR/epoch.stat > $TEMPDIR/epoch.err 2> $TEMPDIR/epoch.out activity="compare results" -diff -b -B $TEMPDIR/epoch.out - < true YRMODA(1,1,1) = YRMODA(1901,1,1) => true YRMODA(12,1,1) = YRMODA(1912,1,1) => true diff --git a/tests/expressions/expressions.sh b/tests/expressions/expressions.sh index f1ff5050..b4850d7e 100755 --- a/tests/expressions/expressions.sh +++ b/tests/expressions/expressions.sh @@ -1304,7 +1304,8 @@ $SUPERVISOR $here/../src/pspp --testing-mode -o raw-ascii \ $TEMPDIR/expr-opt.stat >$TEMPDIR/expr-opt.err 2> $TEMPDIR/expr-opt.out activity="compare optimizing output" -diff -B -b $TEMPDIR/expr-list $TEMPDIR/expr-opt.out +perl -pi -e 's/^\s*$//g' $TEMPDIR/expr-list $TEMPDIR/expr-opt.out +diff -b $TEMPDIR/expr-list $TEMPDIR/expr-opt.out if [ $? -ne 0 ] ; then fail ; fi activity="create non-optimizing input" @@ -1319,7 +1320,8 @@ $SUPERVISOR $here/../src/pspp --testing-mode -o raw-ascii \ $TEMPDIR/expr-noopt.stat >$TEMPDIR/expr-noopt.err 2> $TEMPDIR/expr-noopt.out activity="compare non-optimizing output" -diff -B -b $TEMPDIR/expr-list $TEMPDIR/expr-noopt.out +perl -pi -e 's/^\s*$//g' $TEMPDIR/expr-list $TEMPDIR/expr-noopt.out +diff -b $TEMPDIR/expr-list $TEMPDIR/expr-noopt.out if [ $? -ne 0 ] ; then fail ; fi activity="create optimizing postfix input" diff --git a/tests/expressions/randist.sh b/tests/expressions/randist.sh index 8954338e..bb02172f 100755 --- a/tests/expressions/randist.sh +++ b/tests/expressions/randist.sh @@ -64,7 +64,8 @@ if [ $? -ne 0 ] ; then fail ; fi for d in beta cauchy chisq exp f gamma laplace logistic lnormal \ normal pareto t uniform weibull; do activity="compare output for $d distribution" - diff -B -b $top_srcdir/tests/expressions/randist/$d.out $TEMPDIR/$d.out + perl -pi -e 's/^\s*$//g' $top_srcdir/tests/expressions/randist/$d.out $TEMPDIR/$d.out + diff -b $top_srcdir/tests/expressions/randist/$d.out $TEMPDIR/$d.out if [ $? -ne 0 ] ; then fail ; fi done diff --git a/tests/expressions/variables.sh b/tests/expressions/variables.sh index 0d32df42..444274e9 100755 --- a/tests/expressions/variables.sh +++ b/tests/expressions/variables.sh @@ -97,7 +97,8 @@ $SUPERVISOR $here/../src/pspp -o raw-ascii $TEMPDIR/variables.stat > $TEMPDIR/va if [ $? -ne 0 ] ; then fail ; fi activity="compare results" -diff -b -B $TEMPDIR/pspp.list - < $TEMPDIR/vect if [ $? -ne 0 ] ; then fail ; fi activity="compare results" -diff -b -B $TEMPDIR/pspp.list - <$TEMPDIR/moments-2p.err 2> $TEMPDIR/moments-2p.out activity="compare two-pass output" -diff -B -b $TEMPDIR/moments-list-2p $TEMPDIR/moments-2p.out +perl -pi -e 's/^\s*$//g' $TEMPDIR/moments-list-2p $TEMPDIR/moments-2p.out +diff -b $TEMPDIR/moments-list-2p $TEMPDIR/moments-2p.out if [ $? -ne 0 ] ; then fail ; fi activity="create input file" @@ -94,7 +95,8 @@ $SUPERVISOR $here/../src/pspp --testing-mode -o raw-ascii \ $TEMPDIR/moments-1p.stat >$TEMPDIR/moments-1p.err 2> $TEMPDIR/moments-1p.out activity="compare one-pass output" -diff -B -b $TEMPDIR/moments-list-1p $TEMPDIR/moments-1p.out +perl -pi -e 's/^\s*$//g' $TEMPDIR/moments-list-1p $TEMPDIR/moments-1p.out +diff -b $TEMPDIR/moments-list-1p $TEMPDIR/moments-1p.out if [ $? -ne 0 ] ; then fail ; fi pass diff --git a/tests/stats/percentiles-compatible.sh b/tests/stats/percentiles-compatible.sh index b3d997db..fbd275ae 100755 --- a/tests/stats/percentiles-compatible.sh +++ b/tests/stats/percentiles-compatible.sh @@ -76,7 +76,8 @@ $SUPERVISOR $here/../src/pspp -o raw-ascii $TEMPDIR/prog.sps if [ $? -ne 0 ] ; then no_result ; fi activity="compare output $i" -diff -B -b $TEMPDIR/pspp.list - < $TEMPDIR/c if [ $? -ne 0 ] ; then no_result ; fi activity="compare results" -diff -b -B $TEMPDIR/casefile.out - <