[Pkg-octave-commit] [octave-io] 06/08: Add a testsuite for {xls, ods}read on various example files.

Sébastien Villemot sebastien at debian.org
Thu Feb 20 15:11:19 UTC 2014


This is an automated email from the git hooks/post-receive script.

sebastien pushed a commit to branch master
in repository octave-io.

commit ca9b3ecb25d5a8ccc3f7ce0ac7a5e6f5bab47fdd
Author: Sébastien Villemot <sebastien at debian.org>
Date:   Thu Feb 20 15:37:32 2014 +0100

    Add a testsuite for {xls,ods}read on various example files.
---
 debian/check.m                 |  21 +++++++++++++++++++++
 debian/control                 |   5 ++++-
 debian/source/include-binaries |   4 ++++
 debian/test.gnumeric           | Bin 0 -> 24090 bytes
 debian/test.ods                | Bin 0 -> 38064 bytes
 debian/test.xls                | Bin 0 -> 61952 bytes
 debian/test.xlsx               | Bin 0 -> 26418 bytes
 debian/testhelper.m            |  32 ++++++++++++++++++++++++++++++++
 8 files changed, 61 insertions(+), 1 deletion(-)

diff --git a/debian/check.m b/debian/check.m
new file mode 100644
index 0000000..1a32f1e
--- /dev/null
+++ b/debian/check.m
@@ -0,0 +1,21 @@
+disp("Testing {xls,ods}read...")
+
+# Test defaults
+
+testhelper("xls")
+testhelper("xlsx")
+testhelper("ods")
+testhelper("gnumeric")
+
+# Test specific interfaces (UNO must be last in each category)
+
+testhelper("xls", "JXL")
+testhelper("xls", "POI")
+testhelper("xls", "UNO")
+
+testhelper("xlsx", "OCT")
+testhelper("xlsx", "POI")
+testhelper("xlsx", "UNO")
+
+testhelper("ods", "OCT")
+testhelper("ods", "UNO")
diff --git a/debian/control b/debian/control
index 778c7c9..f8cfcbb 100644
--- a/debian/control
+++ b/debian/control
@@ -4,7 +4,10 @@ Priority: optional
 Maintainer: Debian Octave Group <pkg-octave-devel at lists.alioth.debian.org>
 Uploaders: Thomas Weber <tweber at debian.org>,
            Sébastien Villemot <sebastien at debian.org>
-Build-Depends: debhelper (>= 9), cdbs, octave-pkg-dev (>= 1.1)
+Build-Depends: debhelper (>= 9), cdbs, octave-pkg-dev (>= 1.1),
+               libreoffice-java-common, libreoffice-core (>= 3.5),
+               libjexcelapi-java, libapache-poi-java (>= 3.9-1~),
+               unzip
 Standards-Version: 3.9.5
 Homepage: http://octave.sourceforge.net/io
 Vcs-Git: git://anonscm.debian.org/pkg-octave/octave-io.git
diff --git a/debian/source/include-binaries b/debian/source/include-binaries
new file mode 100644
index 0000000..3757696
--- /dev/null
+++ b/debian/source/include-binaries
@@ -0,0 +1,4 @@
+debian/test.gnumeric
+debian/test.xls
+debian/test.xlsx
+debian/test.ods
diff --git a/debian/test.gnumeric b/debian/test.gnumeric
new file mode 100644
index 0000000..a4ddb31
Binary files /dev/null and b/debian/test.gnumeric differ
diff --git a/debian/test.ods b/debian/test.ods
new file mode 100644
index 0000000..93aafa4
Binary files /dev/null and b/debian/test.ods differ
diff --git a/debian/test.xls b/debian/test.xls
new file mode 100644
index 0000000..e42604b
Binary files /dev/null and b/debian/test.xls differ
diff --git a/debian/test.xlsx b/debian/test.xlsx
new file mode 100644
index 0000000..b4f43e2
Binary files /dev/null and b/debian/test.xlsx differ
diff --git a/debian/testhelper.m b/debian/testhelper.m
new file mode 100644
index 0000000..cc9d087
--- /dev/null
+++ b/debian/testhelper.m
@@ -0,0 +1,32 @@
+function testhelper(ext, iface)
+  if nargin < 2
+    iface = [];
+  endif
+  fname = [ "debian/test." ext ];
+  try
+    if strcmp(ext, "xls") || strcmp(ext, "xlsx")
+      xlsfinfo(fname, iface);
+      d = xlsread(fname);
+    else
+      odsfinfo(fname, iface);
+      d = odsread(fname);
+    endif
+    assert(size(d) == [ 1001, 2]);
+    dispmsg(ext, iface, 1)
+  catch
+    disp(lasterror.message)
+    dispmsg(ext, iface, 0)
+  end_try_catch
+endfunction
+
+function dispmsg(ext, iface, success)
+  if success
+    r = "OK";
+  else
+    r = "FAIL";
+  endif
+  if isempty(iface)
+    iface = "default interface";
+  endif
+  printf("\n***\n*** %-45s: %s\n***\n\n", sprintf("Read of %s file with %s", ext, iface), r);
+endfunction

-- 
Alioth's /home/groups/pkg-octave/bin/git-commit-notice on /srv/git.debian.org/git/pkg-octave/octave-io.git



More information about the Pkg-octave-commit mailing list