projects
/
pspp-builds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Avoid use of $* in Makefile since it's problematic
[pspp-builds.git]
/
tests
/
command
/
flip.sh
diff --git
a/tests/command/flip.sh
b/tests/command/flip.sh
index db40d1abf3ebb2a82802080bb8c5672686665504..a3e5caf2c896cc84ebad3058ad7bb59d775a398c 100755
(executable)
--- a/
tests/command/flip.sh
+++ b/
tests/command/flip.sh
@@
-5,17
+5,27
@@
TEMPDIR=/tmp/pspp-tst-$$
TESTFILE=$TEMPDIR/`basename $0`.sps
TEMPDIR=/tmp/pspp-tst-$$
TESTFILE=$TEMPDIR/`basename $0`.sps
-here=`pwd`;
+# ensure that top_builddir are absolute
+if [ -z "$top_builddir" ] ; then top_builddir=. ; fi
+if [ -z "$top_srcdir" ] ; then top_srcdir=. ; fi
+top_builddir=`cd $top_builddir; pwd`
+PSPP=$top_builddir/src/ui/terminal/pspp
# ensure that top_srcdir is absolute
# ensure that top_srcdir is absolute
-
cd $top_srcdir; top_srcdir=`
pwd`
+
top_srcdir=`cd $top_srcdir;
pwd`
STAT_CONFIG_PATH=$top_srcdir/config
export STAT_CONFIG_PATH
STAT_CONFIG_PATH=$top_srcdir/config
export STAT_CONFIG_PATH
+LANG=C
+export LANG
cleanup()
{
cleanup()
{
+ if [ x"$PSPP_TEST_NO_CLEANUP" != x ] ; then
+ echo "NOT cleaning $TEMPDIR"
+ return ;
+ fi
cd /
rm -rf $TEMPDIR
}
cd /
rm -rf $TEMPDIR
}
@@
-50,7
+60,8
@@
cd $TEMPDIR
activity="create flip.stat"
cat > $TEMPDIR/flip.stat <<EOF
activity="create flip.stat"
cat > $TEMPDIR/flip.stat <<EOF
-data list /N 1 (a) A B C D 2-9.
+* Test FLIP with NEWNAME or, equivalently, with a variable named CASE_LBL.
+data list notable /N 1 (a) A B C D 2-9.
list.
begin data.
v 1 2 3 4 5
list.
begin data.
v 1 2 3 4 5
@@
-63,27
+74,30
@@
flip newnames=n.
list.
flip.
list.
list.
flip.
list.
+
+* Test FLIP without NEWNAME.
+data list list notable /v1 to v10.
+format all(f2).
+begin data.
+1 2 3 4 5 6 7 8 9 10
+4 5 6 7 8 9 10 11 12 13
+end data.
+
+list.
+
+flip.
+list.
EOF
if [ $? -ne 0 ] ; then no_result ; fi
activity="run program"
EOF
if [ $? -ne 0 ] ; then no_result ; fi
activity="run program"
-$SUPERVISOR $
here/../src/pspp -o raw-ascii
$TEMPDIR/flip.stat
+$SUPERVISOR $
PSPP --testing-mode
$TEMPDIR/flip.stat
if [ $? -ne 0 ] ; then no_result ; fi
activity="compare output"
perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list
diff -b $TEMPDIR/pspp.list - << EOF
if [ $? -ne 0 ] ; then no_result ; fi
activity="compare output"
perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list
diff -b $TEMPDIR/pspp.list - << EOF
-1.1 DATA LIST. Reading 1 record from INLINE.
-+--------+------+-------+------+
-|Variable|Record|Columns|Format|
-#========#======#=======#======#
-|N | 1| 1- 1|A1 |
-|A | 1| 2- 3|F2.0 |
-|B | 1| 4- 5|F2.0 |
-|C | 1| 6- 7|F2.0 |
-|D | 1| 8- 9|F2.0 |
-+--------+------+-------+------+
N A B C D
- -- -- -- --
v 1 2 3 4
N A B C D
- -- -- -- --
v 1 2 3 4
@@
-104,6
+118,22
@@
W 6.00 7.00 8.00 9.00
X 11.00 12.00 13.00 14.00
Y 16.00 17.00 18.00 19.00
Z 21.00 22.00 23.00 24.00
X 11.00 12.00 13.00 14.00
Y 16.00 17.00 18.00 19.00
Z 21.00 22.00 23.00 24.00
+v1 v2 v3 v4 v5 v6 v7 v8 v9 v10
+-- -- -- -- -- -- -- -- -- ---
+ 1 2 3 4 5 6 7 8 9 10
+ 4 5 6 7 8 9 10 11 12 13
+CASE_LBL VAR000 VAR001
+-------- -------- --------
+v1 1.00 4.00
+v2 2.00 5.00
+v3 3.00 6.00
+v4 4.00 7.00
+v5 5.00 8.00
+v6 6.00 9.00
+v7 7.00 10.00
+v8 8.00 11.00
+v9 9.00 12.00
+v10 10.00 13.00
EOF
if [ $? -ne 0 ] ; then fail ; fi
EOF
if [ $? -ne 0 ] ; then fail ; fi