function testhelper(ext, iface)
    pkg load io

    supported = chk_spreadsheet_support("/usr/share/java", 0, "/usr/lib/libreoffice");

    if nargin < 2
        iface = [];
    ## If a specific interface is requested, we check here that it is really supported,
    ## because xlsfinfo() might otherwise fall back to another method.
    elseif strcmp(iface, "POI") && strcmp(ext, "xls")
      assert(bitand(supported, 2))
    elseif strcmp(iface, "POI") && strcmp(ext, "xlsx")
      assert(bitand(supported, 4))
    elseif strcmp(iface, "JXL")
      assert(bitand(supported, 8))
    elseif strcmp(iface, "JOD")
      assert(bitand(supported, 64))
    elseif strcmp(iface, "UNO")
      assert(bitand(supported, 128))
    endif
    fname = [ "debian/tests/test." ext ];
    xlsfinfo(fname, iface, true);
    d = xlsread(fname);
    assert(size(d) == [ 1001, 2]);
endfunction
