From: Ben Pfaff Date: Sun, 26 Sep 2010 05:25:16 +0000 (-0700) Subject: tests: Convert GET DATA /TYPE=GNM tests to use Autotest. X-Git-Tag: v0.7.6~151 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8a0397491d3a82ffd5d3bf80bded0f1562c393a3;p=pspp-builds.git tests: Convert GET DATA /TYPE=GNM tests to use Autotest. --- diff --git a/configure.ac b/configure.ac index e30f93c0..6d01dc90 100644 --- a/configure.ac +++ b/configure.ac @@ -201,7 +201,7 @@ if test $HAVE_LIBXML2 = yes && test $HAVE_ZLIB = yes; then else GNM_SUPPORT=no fi -AM_CONDITIONAL([GNM_SUPPORT], [test $GNM_SUPPORT = yes]) +AC_SUBST([GNM_SUPPORT]) dnl ODT support requires libxml2. if test $HAVE_LIBXML2 = yes; then diff --git a/tests/Book1.gnm.unzipped b/tests/Book1.gnm.unzipped deleted file mode 100644 index 052783e1..00000000 --- a/tests/Book1.gnm.unzipped +++ /dev/null @@ -1,535 +0,0 @@ - - - - - - 4 - WorkbookView::show_horizontal_scrollbar - TRUE - - - 4 - WorkbookView::show_vertical_scrollbar - TRUE - - - 4 - WorkbookView::show_notebook_tabs - TRUE - - - 4 - WorkbookView::do_auto_completion - TRUE - - - 4 - WorkbookView::is_protected - FALSE - - - - - application - gnumeric - - - author - John Darrington - - - - This - vars - That - Empty - Blank - - - - - This - 9 - 17 - 1 - - - - - - - - - - - - - - d_then_r - portrait - - - - - - - - - - - - - - - - - - - - - numeral - eng_name - xxx - 1 - One - Eins - 2 - Two - Zwei - 3 - Three - Drei - Vier - XY - xxx - xxxx - xxxx - yyy - V1 - V2 - yyy - 0 - fred - 20 - $$$$ - yyy - 1 - 11 - 21 - $$$$ - yyyy - 2 - twelve - 22 - $$$$ - yyyy - 3 - 13 - 23 - $$$$ - Eleven - yyyy - 4 - 14 - 24 - $$$$ - zzz - zzz - zzz - zzz - zzz - Seventeen - - - - - - vars - 4 - 8 - 1 - - - - - - - - - - - - - - d_then_r - portrait - - - - - - - - - - - - - - - - - - - 1v12 - var&x@ - a(43) - varx - varx - 1 - 2 - 23 - 2 - 4 - 3 - 4 - 23 - 3 - 4 - - - - - - - That - 3 - 4 - 1 - - - - - - - - - - - - - - d_then_r - portrait - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - name - id - height - fred - 0 - 23.4 - bert - 1 - 0.56 - charlie - 2 - n/a - dick - 3 - -34.09 - - - - - - Empty - -1 - -1 - 1 - - - - - - - - - - - - - - d_then_r - portrait - - - - - - - - - - - - - - - - - - - Blank - 3 - 2 - 1 - - - - - - - - - - - - - - d_then_r - portrait - - - - - - - - - - - - - - - - - - - vone - vtwo - vthree - v4 - 1 - 3 - 5 - 2 - 4 - 6 - - - - - - - - diff --git a/tests/atlocal.in b/tests/atlocal.in index cd61f44b..0a758a20 100644 --- a/tests/atlocal.in +++ b/tests/atlocal.in @@ -4,3 +4,6 @@ CHARSETALIASDIR="$abs_top_builddir/gl" export CHARSETALIASDIR WITH_PERL_MODULE='@WITH_PERL_MODULE@' host='@host@' +GNM_SUPPORT='@GNM_SUPPORT@' +GZIP= +export GZIP diff --git a/tests/automake.mk b/tests/automake.mk index b4f29dd4..82b223dc 100644 --- a/tests/automake.mk +++ b/tests/automake.mk @@ -116,10 +116,6 @@ dist_TESTS = \ tests/expressions/variables.sh \ tests/expressions/vectors.sh -if GNM_SUPPORT -dist_TESTS += tests/command/get-data-gnm.sh -endif - if PSQL_SUPPORT dist_TESTS += tests/command/get-data-psql.sh endif @@ -319,7 +315,6 @@ tests_output_render_test_LDADD = \ EXTRA_DIST += \ $(dist_TESTS) \ - tests/Book1.gnm.unzipped \ tests/weighting.data tests/data-list.data tests/list.data \ tests/no_case_size.sav \ tests/coverage.sh tests/test_template \ @@ -350,7 +345,8 @@ EXTRA_DIST += \ tests/formats/num-out-cmp.pl \ tests/formats/num-out-compare.pl \ tests/formats/num-out-decmp.pl \ - tests/formats/num-out.pl + tests/formats/num-out.pl \ + tests/language/data-io/Book1.gnm.unzipped CLEANFILES += *.save pspp.* foo* diff --git a/tests/language/data-io/Book1.gnm.unzipped b/tests/language/data-io/Book1.gnm.unzipped new file mode 100644 index 00000000..052783e1 --- /dev/null +++ b/tests/language/data-io/Book1.gnm.unzipped @@ -0,0 +1,535 @@ + + + + + + 4 + WorkbookView::show_horizontal_scrollbar + TRUE + + + 4 + WorkbookView::show_vertical_scrollbar + TRUE + + + 4 + WorkbookView::show_notebook_tabs + TRUE + + + 4 + WorkbookView::do_auto_completion + TRUE + + + 4 + WorkbookView::is_protected + FALSE + + + + + application + gnumeric + + + author + John Darrington + + + + This + vars + That + Empty + Blank + + + + + This + 9 + 17 + 1 + + + + + + + + + + + + + + d_then_r + portrait + + + + + + + + + + + + + + + + + + + + + numeral + eng_name + xxx + 1 + One + Eins + 2 + Two + Zwei + 3 + Three + Drei + Vier + XY + xxx + xxxx + xxxx + yyy + V1 + V2 + yyy + 0 + fred + 20 + $$$$ + yyy + 1 + 11 + 21 + $$$$ + yyyy + 2 + twelve + 22 + $$$$ + yyyy + 3 + 13 + 23 + $$$$ + Eleven + yyyy + 4 + 14 + 24 + $$$$ + zzz + zzz + zzz + zzz + zzz + Seventeen + + + + + + vars + 4 + 8 + 1 + + + + + + + + + + + + + + d_then_r + portrait + + + + + + + + + + + + + + + + + + + 1v12 + var&x@ + a(43) + varx + varx + 1 + 2 + 23 + 2 + 4 + 3 + 4 + 23 + 3 + 4 + + + + + + + That + 3 + 4 + 1 + + + + + + + + + + + + + + d_then_r + portrait + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + name + id + height + fred + 0 + 23.4 + bert + 1 + 0.56 + charlie + 2 + n/a + dick + 3 + -34.09 + + + + + + Empty + -1 + -1 + 1 + + + + + + + + + + + + + + d_then_r + portrait + + + + + + + + + + + + + + + + + + + Blank + 3 + 2 + 1 + + + + + + + + + + + + + + d_then_r + portrait + + + + + + + + + + + + + + + + + + + vone + vtwo + vthree + v4 + 1 + 3 + 5 + 2 + 4 + 6 + + + + + + + + diff --git a/tests/language/data-io/get-data.at b/tests/language/data-io/get-data.at index 1ce180a9..3b4d8b73 100644 --- a/tests/language/data-io/get-data.at +++ b/tests/language/data-io/get-data.at @@ -567,3 +567,166 @@ x 100 ]) AT_CLEANUP + +AT_BANNER([GET DATA /TYPE=GNM]) + +AT_SETUP([GET DATA /TYPE=GNM with CELLRANGE]) +AT_SKIP_IF([test "$GNM_SUPPORT" = no]) +AT_CHECK([gzip -c $top_srcdir/tests/language/data-io/Book1.gnm.unzipped > Book1.gnumeric]) +AT_DATA([get-data.sps], [dnl +GET DATA /TYPE=gnm /FILE='Book1.gnumeric' /READNAMES=off /SHEET=name 'This' /CELLRANGE=range 'g9:i13' . +DISPLAY VARIABLES. +LIST. +]) +AT_CHECK([pspp -o pspp.csv get-data.sps]) +AT_CHECK([cat pspp.csv], [0], [dnl +Variable,Description,,Position +VAR001,Format: F8.2,,1 +,Measure: Scale,, +,Display Alignment: Right,, +,Display Width: 8,, +VAR002,Format: A8,,2 +,Measure: Nominal,, +,Display Alignment: Left,, +,Display Width: 8,, +VAR003,Format: F8.2,,3 +,Measure: Scale,, +,Display Alignment: Right,, +,Display Width: 8,, + +Table: Data List +VAR001,VAR002,VAR003 +.00,fred ,20.00 +1.00,11 ,21.00 +2.00,twelve ,22.00 +3.00,13 ,23.00 +4.00,14 ,24.00 +]) +AT_CLEANUP + +AT_SETUP([GET DATA /TYPE=GNM with CELLRANGE and READNAMES]) +AT_SKIP_IF([test "$GNM_SUPPORT" = no]) +AT_CHECK([gzip -c $top_srcdir/tests/language/data-io/Book1.gnm.unzipped > Book1.gnumeric]) +AT_DATA([get-data.sps], [dnl +GET DATA /TYPE=gnm /FILE='Book1.gnumeric' /READNAMES=on /SHEET=name 'This' /CELLRANGE=range 'g8:i13' . +DISPLAY VARIABLES. +LIST. +]) +AT_CHECK([pspp -o pspp.csv get-data.sps]) +AT_CHECK([cat pspp.csv], [0], [dnl +Variable,Description,,Position +V1,Format: F8.2,,1 +,Measure: Scale,, +,Display Alignment: Right,, +,Display Width: 8,, +V2,Format: A8,,2 +,Measure: Nominal,, +,Display Alignment: Left,, +,Display Width: 8,, +VAR001,Format: F8.2,,3 +,Measure: Scale,, +,Display Alignment: Right,, +,Display Width: 8,, + +Table: Data List +V1,V2,VAR001 +.00,fred ,20.00 +1.00,11 ,21.00 +2.00,twelve ,22.00 +3.00,13 ,23.00 +4.00,14 ,24.00 +]) +AT_CLEANUP + +AT_SETUP([GET DATA /TYPE=GNM without CELLRANGE]) +AT_SKIP_IF([test "$GNM_SUPPORT" = no]) +AT_CHECK([gzip -c $top_srcdir/tests/language/data-io/Book1.gnm.unzipped > Book1.gnumeric]) +AT_DATA([get-data.sps], [dnl +GET DATA /TYPE=gnm /FILE='Book1.gnumeric' /SHEET=index 3. +DISPLAY VARIABLES. +LIST. +]) +AT_CHECK([pspp -o pspp.csv get-data.sps]) +AT_CHECK([cat pspp.csv], [0], [dnl +Variable,Description,,Position +name,Format: A8,,1 +,Measure: Nominal,, +,Display Alignment: Left,, +,Display Width: 8,, +id,Format: F8.2,,2 +,Measure: Scale,, +,Display Alignment: Right,, +,Display Width: 8,, +height,Format: F8.2,,3 +,Measure: Scale,, +,Display Alignment: Right,, +,Display Width: 8,, + +Table: Data List +name,id,height +fred ,.00,23.40 +bert ,1.00,.56 +charlie ,2.00,. @&t@ +dick ,3.00,-34.09 +]) +AT_CLEANUP + +AT_SETUP([GET DATA /TYPE=GNM with missing data]) +AT_SKIP_IF([test "$GNM_SUPPORT" = no]) +AT_CHECK([gzip -c $top_srcdir/tests/language/data-io/Book1.gnm.unzipped > Book1.gnumeric]) +AT_DATA([get-data.sps], [dnl +* This sheet has no data in one of its variables +GET DATA /TYPE=gnm /FILE='Book1.gnumeric' /READNAMES=on /SHEET=index 5. +DISPLAY VARIABLES. +LIST. +]) +AT_CHECK([pspp -o pspp.csv get-data.sps]) +AT_CHECK([cat pspp.csv], [0], [dnl +Variable,Description,,Position +vone,Format: F8.2,,1 +,Measure: Scale,, +,Display Alignment: Right,, +,Display Width: 8,, +vtwo,Format: F8.2,,2 +,Measure: Scale,, +,Display Alignment: Right,, +,Display Width: 8,, +vthree,Format: A8,,3 +,Measure: Nominal,, +,Display Alignment: Left,, +,Display Width: 8,, +v4,Format: F8.2,,4 +,Measure: Scale,, +,Display Alignment: Right,, +,Display Width: 8,, + +Table: Data List +vone,vtwo,vthree,v4 +1.00,3.00,,5.00 +2.00,4.00,,6.00 +]) +AT_CLEANUP + +AT_SETUP([GET DATA /TYPE=GNM with empty sheet]) +AT_SKIP_IF([test "$GNM_SUPPORT" = no]) +AT_CHECK([gzip -c $top_srcdir/tests/language/data-io/Book1.gnm.unzipped > Book1.gnumeric]) +AT_DATA([get-data.sps], [dnl +* This sheet is empty +GET DATA /TYPE=gnm /FILE='Book1.gnumeric' /SHEET=name 'Empty'. +]) +AT_CHECK([pspp -o pspp.csv get-data.sps], [0], [dnl +warning: Selected sheet or range of spreadsheet `Book1.gnumeric' is empty. +]) +AT_CLEANUP + +AT_SETUP([GET DATA /TYPE=GNM with nonexistent sheet]) +AT_SKIP_IF([test "$GNM_SUPPORT" = no]) +AT_CHECK([gzip -c $top_srcdir/tests/language/data-io/Book1.gnm.unzipped > Book1.gnumeric]) +AT_DATA([get-data.sps], [dnl +* This sheet doesnt exist. +GET DATA /TYPE=gnm /FILE='Book1.gnumeric' /SHEET=name 'foobarxx'. +]) +AT_CHECK([pspp -o pspp.csv get-data.sps], [0], [dnl +warning: Selected sheet or range of spreadsheet `Book1.gnumeric' is empty. +]) +AT_CLEANUP