X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=tests%2Fcommand%2Fget-data-txt-examples.sh;h=3900fa403c8d3e4cdf0decf484546bf55c7d4700;hb=934ab1787fa4b4799e5bafd39ef650826895d567;hp=56cbd3b380c7f130cee1f619bb04bab31f94621d;hpb=2a2e0fe99b3bdf364bff6f0eb7a13ce40be9488c;p=pspp diff --git a/tests/command/get-data-txt-examples.sh b/tests/command/get-data-txt-examples.sh index 56cbd3b380..3900fa403c 100755 --- a/tests/command/get-data-txt-examples.sh +++ b/tests/command/get-data-txt-examples.sh @@ -9,7 +9,7 @@ TEMPDIR=/tmp/pspp-tst-$$ 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 +PSPP=$top_builddir/src/ui/terminal/pspp$EXEEXT # ensure that top_srcdir is absolute top_srcdir=`cd $top_srcdir; pwd` @@ -22,6 +22,10 @@ export LANG cleanup() { + if [ x"$PSPP_TEST_NO_CLEANUP" != x ] ; then + echo "NOT cleaning $TEMPDIR" + return ; + fi cd / rm -rf $TEMPDIR } @@ -75,12 +79,12 @@ if [ $? -ne 0 ] ; then no_result ; fi activity="create pets.data" cat > pets.data <<'EOF' -"Pet Name", "Age", "Color", "Date Received", "Price", "Needs Walking", "Type" +'Pet''s Name', "Age", "Color", "Date Received", "Price", "Height", "Type" , (Years), , , (Dollars), , -"Rover", 4.5, Brown, "12 Feb 2004", 80, True, "Dog" -"Charlie", , Gold, "5 Apr 2007", 12.3, False, "Fish" -"Molly", 2, Black, "12 Dec 2006", 25, False, "Cat" -"Gilly", , White, "10 Apr 2007", 10, False, "Guinea Pig" +"Rover", 4.5, Brown, "12 Feb 2004", 80, '1''4"', "Dog" +"Charlie", , Gold, "5 Apr 2007", 12.3, "3""", "Fish" +"Molly", 2, Black, "12 Dec 2006", 25, '5"', "Cat" +"Gilly", , White, "10 Apr 2007", 10, "3""", "Guinea Pig" EOF if [ $? -ne 0 ] ; then no_result ; fi @@ -114,50 +118,52 @@ GET DATA /TYPE=TXT /FILE='cars.data' /ARRANGEMENT=FIXED /FIRSTCASE=2 age 40-47 F. LIST. -GET DATA /TYPE=TXT /FILE='pets.data' /DELIMITERS=', ' /QUALIFIER='"' +GET DATA /TYPE=TXT /FILE='pets.data' /DELIMITERS=', ' /QUALIFIER='''"' /ESCAPE /FIRSTCASE=3 /VARIABLES=name A10 age F3.1 color A5 received EDATE10 price F5.2 - needs_walking a5 + height a5 type a10. LIST. EOF if [ $? -ne 0 ] ; then no_result ; fi activity="run test" -$SUPERVISOR $PSPP --testing-mode test.pspp +$SUPERVISOR $PSPP -o pspp.csv test.pspp if [ $? -ne 0 ] ; then no_result ; fi activity="compare test results" -perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list -diff -b $TEMPDIR/pspp.list - <<'EOF' - username password uid gid gecos home shell --------------------- ---------------------------------------- ---------- ---------- ---------------------------------------- ---------------------------------------- ---------------------------------------- -root $1$nyeSP5gD$pDq/ 0 0 ,,, /root /bin/bash -blp $1$BrP/pFg4$g7OG 1000 1000 Ben Pfaff,,, /home/blp /bin/bash -john $1$JBuq/Fioq$g4A 1001 1001 John Darrington,,, /home/john /bin/bash -jhs $1$D3li4hPL$88X1 1002 1002 Jason Stover,,, /home/jhs /bin/csh - model year mileage price type age --------- ---- ------- ----- ---- --- -Civic 2002 29883 15900 Si 2 -Civic 2003 13415 15900 EX 1 -Civic 1992 107000 3800 n/a 12 -Accord 2002 26613 17900 EX 1 - model year mileage price type age --------- -------- -------- -------- -------- -------- -Civic 2002 29883 15900 Si 2 -Civic 2003 13415 15900 EX 1 -Civic 1992 107000 3800 n/a 12 -Accord 2002 26613 17900 EX 1 - name age color received price needs_walking type ----------- ---- ----- ---------- ------ ------------- ---------- -Rover 4.5 Brown 12.02.2004 80.00 True Dog -Charlie . Gold 05.04.2007 12.30 False Fish -Molly 2.0 Black 12.12.2006 25.00 False Cat -Gilly . White 10.04.2007 10.00 False Guinea Pig +diff -c $TEMPDIR/pspp.csv - <<'EOF' +Table: Data List +username,password,uid,gid,gecos,home,shell +root ,$1$nyeSP5gD$pDq/ ,0,0,",,, ",/root ,/bin/bash +blp ,$1$BrP/pFg4$g7OG ,1000,1000,"Ben Pfaff,,, ",/home/blp ,/bin/bash +john ,$1$JBuq/Fioq$g4A ,1001,1001,"John Darrington,,, ",/home/john ,/bin/bash +jhs ,$1$D3li4hPL$88X1 ,1002,1002,"Jason Stover,,, ",/home/jhs ,/bin/csh + +Table: Data List +model,year,mileage,price,type,age +Civic ,2002,29883,15900,Si ,2 +Civic ,2003,13415,15900,EX ,1 +Civic ,1992,107000,3800,n/a ,12 +Accord ,2002,26613,17900,EX ,1 + +Table: Data List +model,year,mileage,price,type,age +Civic ,2002,29883,15900,Si ,2 +Civic ,2003,13415,15900,EX ,1 +Civic ,1992,107000,3800,n/a ,12 +Accord ,2002,26613,17900,EX ,1 + +Table: Data List +name,age,color,received,price,height,type +Rover ,4.5,Brown,12.02.2004,80.00,"1'4"" ",Dog +Charlie ,. ,Gold ,05.04.2007,12.30,"3"" ",Fish +Molly ,2.0,Black,12.12.2006,25.00,"5"" ",Cat +Gilly ,. ,White,10.04.2007,10.00,"3"" ",Guinea Pig EOF if [ $? -ne 0 ] ; then fail ; fi