X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=tests%2Flanguage%2Fdata-io%2Fget-data-spreadsheet.at;h=cc03ade98325186414404dd83ad6831b63b4b809;hb=a965acea74a93eba5c78c17c6595eef9a776a464;hp=28b9686c863b4b64efba5bc8b3bf3967633f8a8a;hpb=c0f256a4ff6d51ab0ce34c30fc12681686a41033;p=pspp diff --git a/tests/language/data-io/get-data-spreadsheet.at b/tests/language/data-io/get-data-spreadsheet.at index 28b9686c86..cc03ade983 100644 --- a/tests/language/data-io/get-data-spreadsheet.at +++ b/tests/language/data-io/get-data-spreadsheet.at @@ -1,9 +1,24 @@ - +dnl PSPP - a program for statistical analysis. +dnl Copyright (C) 2017 Free Software Foundation, Inc. +dnl +dnl This program is free software: you can redistribute it and/or modify +dnl it under the terms of the GNU General Public License as published by +dnl the Free Software Foundation, either version 3 of the License, or +dnl (at your option) any later version. +dnl +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +dnl GNU General Public License for more details. +dnl +dnl You should have received a copy of the GNU General Public License +dnl along with this program. If not, see . +dnl m4_define([SPREADSHEET_TEST_PREP],[dnl m4_if($1,[GNM],[dnl AT_CHECK([gzip -c $top_srcdir/tests/language/data-io/Book1.gnm.unzipped > Book1.gnumeric])dnl m4_define([testsheet],[Book1.gnumeric])dnl - AT_SKIP_IF([test n$GNM_SUPPORT != nyes])dnl + AT_SKIP_IF([test n$GNM_READ_SUPPORT != nyes])dnl ]) dnl m4_if($1,[ODS],[dnl AT_CHECK([cp $top_srcdir/tests/language/data-io/test.ods test.ods])dnl @@ -23,19 +38,10 @@ 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,, +Variable,Description,Position +VAR001,Format: F8.2,1 +VAR002,Format: A8,2 +VAR003,Format: F8.2,3 Table: Data List VAR001,VAR002,VAR003 @@ -56,19 +62,10 @@ 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,, +Variable,Description,Position +V1,Format: F8.2,1 +V2,Format: A8,2 +VAR001,Format: F8.2,3 Table: Data List V1,V2,VAR001 @@ -87,21 +84,13 @@ GET DATA /TYPE=$1 /FILE='testsheet' /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,, +AT_CHECK([pspp -O format=csv get-data.sps], [0], [dnl +Variable,Description,Position +name,Format: A8,1 +id,Format: F8.2,2 +height,Format: F8.2,3 + +warning: Cannot convert the value in the spreadsheet cell C4 to format (F8.2): Field contents are not numeric. Table: Data List name,id,height @@ -122,23 +111,11 @@ 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,, +Variable,Description,Position +vone,Format: F8.2,1 +vtwo,Format: F8.2,2 +vthree,Format: A8,3 +v4,Format: F8.2,4 Table: Data List vone,vtwo,vthree,v4 @@ -193,6 +170,7 @@ CHECK_SPREADSHEET_READER([GNM]) dnl Check for a bug where gnumeric files were interpreted incorrectly AT_SETUP([GET DATA /TYPE=GNM sheet index bug]) +AT_SKIP_IF([test n$GNM_READ_SUPPORT != nyes]) AT_DATA([minimal3.gnumeric],[dnl @@ -341,6 +319,7 @@ AT_CLEANUP dnl Check for a bug where certain gnumeric files failed an assertion AT_SETUP([GET DATA /TYPE=GNM assert-fail]) +AT_SKIP_IF([test n$GNM_READ_SUPPORT != nyes]) AT_DATA([read.sps],[dnl GET DATA /TYPE=GNM @@ -395,3 +374,19 @@ AT_BANNER([GET DATA Spreadsheet /TYPE=ODS]) CHECK_SPREADSHEET_READER([ODS]) + +AT_SETUP([GET DATA /TYPE=ODS crash]) +AT_SKIP_IF([test n$ODF_READ_SUPPORT != nyes]) + + +AT_CHECK([cp $top_srcdir/tests/language/data-io/newone.ods this.ods])dnl + +AT_DATA([crash.sps],[dnl +GET DATA /TYPE=ODS /FILE='this.ods' /CELLRANGE=RANGE 'A1:C8' /READNAMES=ON +LIST. +]) + +AT_CHECK([pspp -O format=csv crash.sps], [0], [ignore]) + +AT_CLEANUP +