octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: make check recommended practice?


From: David Bateman
Subject: Re: make check recommended practice?
Date: Tue, 04 Dec 2007 02:33:14 +0100
User-agent: Thunderbird 1.5.0.7 (X11/20060921)

Moritz Borgmann wrote:
> looks great to me! The only thing missing AFAICT is some notice to the
> user that tests are skipped. Where should we put this?
> 
> Provided that I find some time, I may even volunteer to put in some
> testif blocks. I have a pretty minimal build here without bells and
> whistles.
> 
> Thanks,
> 

Please consider the attached patch that I believe gets most of the
sparse tests that will fail with suitesparse, prints the number of
skipped tests for the "make check" target and a couple of other small
things.

D.


Index: scripts/testfun/test.m
===================================================================
RCS file: /usr/local/cvsroot/octave/scripts/testfun/test.m,v
retrieving revision 1.22
diff -c -r1.22 test.m
*** scripts/testfun/test.m      3 Dec 2007 23:52:07 -0000       1.22
--- scripts/testfun/test.m      4 Dec 2007 01:31:17 -0000
***************
*** 480,486 ****
        fputs (__fid, __msg);
        fflush (__fid);
        ## show the variable context
!       if (! strcmp (__type, "error") && ! all (__shared == " "))
        fputs (__fid, "shared variables ");
        eval (sprintf ("fdisp(__fid,bundle(%s));", __shared)); 
        fflush (__fid);
--- 480,487 ----
        fputs (__fid, __msg);
        fflush (__fid);
        ## show the variable context
!       if (! strcmp (__type, "error") && ! strcmp (__type, "testif") &&
!         ! all (__shared == " "))
        fputs (__fid, "shared variables ");
        eval (sprintf ("fdisp(__fid,bundle(%s));", __shared)); 
        fflush (__fid);
***************
*** 618,626 ****
  %!testif OCTAVE_SOURCE
  %! ## This test should be run
  %! assert (true);
! %!testif HAVE_FOOBAR
! %! ## missing feature. Fail if this test is run
! %! error("Failed missing feature test");
  
  ### Test for a known failure
  %!xtest error("This test is known to fail")
--- 619,629 ----
  %!testif OCTAVE_SOURCE
  %! ## This test should be run
  %! assert (true);
! 
! ### Disable this test to avoid spurious skipped test for "make check"
! % !testif HAVE_FOOBAR
! % ! ## missing feature. Fail if this test is run
! % ! error("Failed missing feature test");
  
  ### Test for a known failure
  %!xtest error("This test is known to fail")
Index: src/DLD-FUNCTIONS/luinc.cc
===================================================================
RCS file: /usr/local/cvsroot/octave/src/DLD-FUNCTIONS/luinc.cc,v
retrieving revision 1.14
diff -c -r1.14 luinc.cc
*** src/DLD-FUNCTIONS/luinc.cc  12 Oct 2007 21:27:35 -0000      1.14
--- src/DLD-FUNCTIONS/luinc.cc  4 Dec 2007 01:31:17 -0000
***************
*** 300,306 ****
  
  /*
  
! %!test
  %! a=sparse([1,2,0,0;0,1,2,0;1e-14,0,3,0;0,0,0,1]);
  %! [l,u]=luinc(a,1e-10);
  %! assert(l*u, sparse([1,2,0,0;0,1,2,0;0,0,3,0;0,0,0,1]),1e-10);
--- 300,306 ----
  
  /*
  
! %!testif HAVE_UMFPACK
  %! a=sparse([1,2,0,0;0,1,2,0;1e-14,0,3,0;0,0,0,1]);
  %! [l,u]=luinc(a,1e-10);
  %! assert(l*u, sparse([1,2,0,0;0,1,2,0;0,0,3,0;0,0,0,1]),1e-10);
***************
*** 308,314 ****
  %! [l,u]=luinc(a,opts);
  %! assert(l*u, sparse([1,2,0,0;0,1,2,0;0,0,3,0;0,0,0,1]),1e-10);
  
! %!test
  %! a=sparse([1i,2,0,0;0,1,2,0;1e-14,0,3,0;0,0,0,1]);
  %! [l,u]=luinc(a,1e-10);
  %! assert(l*u, sparse([1i,2,0,0;0,1,2,0;0,0,3,0;0,0,0,1]),1e-10);
--- 308,314 ----
  %! [l,u]=luinc(a,opts);
  %! assert(l*u, sparse([1,2,0,0;0,1,2,0;0,0,3,0;0,0,0,1]),1e-10);
  
! %!testif HAVE_UMFPACK
  %! a=sparse([1i,2,0,0;0,1,2,0;1e-14,0,3,0;0,0,0,1]);
  %! [l,u]=luinc(a,1e-10);
  %! assert(l*u, sparse([1i,2,0,0;0,1,2,0;0,0,3,0;0,0,0,1]),1e-10);
Index: src/DLD-FUNCTIONS/spqr.cc
===================================================================
RCS file: /usr/local/cvsroot/octave/src/DLD-FUNCTIONS/spqr.cc,v
retrieving revision 1.10
diff -c -r1.10 spqr.cc
*** src/DLD-FUNCTIONS/spqr.cc   12 Oct 2007 21:27:35 -0000      1.10
--- src/DLD-FUNCTIONS/spqr.cc   4 Dec 2007 01:31:17 -0000
***************
*** 148,160 ****
  The deactivated tests below can't be tested till rectangular back-subs is
  implemented for sparse matrices.
  
! %!test
  %! n = 20; d= 0.2;
  %! a = sprandn(n,n,d)+speye(n,n);
  %! r = spqr(a);
  %! assert(r'*r,a'*a,1e-10)
  
! %!test
  %! n = 20; d= 0.2;
  %! a = sprandn(n,n,d)+speye(n,n);
  %! q = symamd(a);
--- 148,160 ----
  The deactivated tests below can't be tested till rectangular back-subs is
  implemented for sparse matrices.
  
! %!testif HAVE_CXSPARSE
  %! n = 20; d= 0.2;
  %! a = sprandn(n,n,d)+speye(n,n);
  %! r = spqr(a);
  %! assert(r'*r,a'*a,1e-10)
  
! %!testif HAVE_CXSPARSE
  %! n = 20; d= 0.2;
  %! a = sprandn(n,n,d)+speye(n,n);
  %! q = symamd(a);
***************
*** 162,174 ****
  %! r = spqr(a);
  %! assert(r'*r,a'*a,1e-10)
  
! %!test
  %! n = 20; d= 0.2;
  %! a = sprandn(n,n,d)+speye(n,n);
  %! [c,r] = spqr(a,ones(n,1));
  %! assert (r\c,full(a)\ones(n,1),10e-10)
  
! %!test
  %! n = 20; d= 0.2;
  %! a = sprandn(n,n,d)+speye(n,n);
  %! b = randn(n,2);
--- 162,174 ----
  %! r = spqr(a);
  %! assert(r'*r,a'*a,1e-10)
  
! %!testif HAVE_CXSPARSE
  %! n = 20; d= 0.2;
  %! a = sprandn(n,n,d)+speye(n,n);
  %! [c,r] = spqr(a,ones(n,1));
  %! assert (r\c,full(a)\ones(n,1),10e-10)
  
! %!testif HAVE_CXSPARSE
  %! n = 20; d= 0.2;
  %! a = sprandn(n,n,d)+speye(n,n);
  %! b = randn(n,2);
***************
*** 176,195 ****
  %! assert (r\c,full(a)\b,10e-10)
  
  %% Test under-determined systems!!
! %!#test
  %! n = 20; d= 0.2;
  %! a = sprandn(n,n+1,d)+speye(n,n+1);
  %! b = randn(n,2);
  %! [c,r] = spqr(a,b);
  %! assert (r\c,full(a)\b,10e-10)
  
! %!test
  %! n = 20; d= 0.2;
  %! a = 1i*sprandn(n,n,d)+speye(n,n);
  %! r = spqr(a);
  %! assert(r'*r,a'*a,1e-10)
  
! %!test
  %! n = 20; d= 0.2;
  %! a = 1i*sprandn(n,n,d)+speye(n,n);
  %! q = symamd(a);
--- 176,195 ----
  %! assert (r\c,full(a)\b,10e-10)
  
  %% Test under-determined systems!!
! %!#testif HAVE_CXSPARSE
  %! n = 20; d= 0.2;
  %! a = sprandn(n,n+1,d)+speye(n,n+1);
  %! b = randn(n,2);
  %! [c,r] = spqr(a,b);
  %! assert (r\c,full(a)\b,10e-10)
  
! %!testif HAVE_CXSPARSE
  %! n = 20; d= 0.2;
  %! a = 1i*sprandn(n,n,d)+speye(n,n);
  %! r = spqr(a);
  %! assert(r'*r,a'*a,1e-10)
  
! %!testif HAVE_CXSPARSE
  %! n = 20; d= 0.2;
  %! a = 1i*sprandn(n,n,d)+speye(n,n);
  %! q = symamd(a);
***************
*** 197,209 ****
  %! r = spqr(a);
  %! assert(r'*r,a'*a,1e-10)
  
! %!test
  %! n = 20; d= 0.2;
  %! a = 1i*sprandn(n,n,d)+speye(n,n);
  %! [c,r] = spqr(a,ones(n,1));
  %! assert (r\c,full(a)\ones(n,1),10e-10)
  
! %!test
  %! n = 20; d= 0.2;
  %! a = 1i*sprandn(n,n,d)+speye(n,n);
  %! b = randn(n,2);
--- 197,209 ----
  %! r = spqr(a);
  %! assert(r'*r,a'*a,1e-10)
  
! %!testif HAVE_CXSPARSE
  %! n = 20; d= 0.2;
  %! a = 1i*sprandn(n,n,d)+speye(n,n);
  %! [c,r] = spqr(a,ones(n,1));
  %! assert (r\c,full(a)\ones(n,1),10e-10)
  
! %!testif HAVE_CXSPARSE
  %! n = 20; d= 0.2;
  %! a = 1i*sprandn(n,n,d)+speye(n,n);
  %! b = randn(n,2);
***************
*** 211,217 ****
  %! assert (r\c,full(a)\b,10e-10)
  
  %% Test under-determined systems!!
! %!#test
  %! n = 20; d= 0.2;
  %! a = 1i*sprandn(n,n+1,d)+speye(n,n+1);
  %! b = randn(n,2);
--- 211,217 ----
  %! assert (r\c,full(a)\b,10e-10)
  
  %% Test under-determined systems!!
! %!#testif HAVE_CXSPARSE
  %! n = 20; d= 0.2;
  %! a = 1i*sprandn(n,n+1,d)+speye(n,n+1);
  %! b = randn(n,2);
***************
*** 352,363 ****
  
  /* 
  
! %!test
  %! n=20;
  %! a=speye(n,n);a=a(randperm(n),:);
  %! assert(a(dmperm(a),:),speye(n))
  
! %!test
  %! n=20;
  %! d=0.2;
  %! a=tril(sprandn(n,n,d),-1)+speye(n,n);
--- 352,363 ----
  
  /* 
  
! %!testif HAVE_CXSPARSE
  %! n=20;
  %! a=speye(n,n);a=a(randperm(n),:);
  %! assert(a(dmperm(a),:),speye(n))
  
! %!testif HAVE_CXSPARSE
  %! n=20;
  %! d=0.2;
  %! a=tril(sprandn(n,n,d),-1)+speye(n,n);
***************
*** 402,409 ****
  /* 
  
  %!error(sprank(1,2));
! %!assert(sprank(speye(20)), 20)
! %!assert(sprank([1,0,2,0;2,0,4,0]),2)
  
  */
  /*
--- 402,411 ----
  /* 
  
  %!error(sprank(1,2));
! %!testif HAVE_CXSPARSE
! %! assert(sprank(speye(20)), 20)
! %!testif HAVE_CXSPARSE
! %! assert(sprank([1,0,2,0;2,0,4,0]),2)
  
  */
  /*
Index: test/build_sparse_tests.sh
===================================================================
RCS file: /usr/local/cvsroot/octave/test/build_sparse_tests.sh,v
retrieving revision 1.11
diff -c -r1.11 build_sparse_tests.sh
*** test/build_sparse_tests.sh  27 Nov 2007 01:38:49 -0000      1.11
--- test/build_sparse_tests.sh  4 Dec 2007 01:31:18 -0000
***************
*** 179,185 ****
  %% Note that the last four do not fail, but rather give a warning
  %% of a singular matrix, which is consistent with the full matrix
  %% behaviour. They are therefore disabled.. 
! %!assert(spinv(sparse([1,1;1,1+i])),sparse([1-1i,1i;1i,-1i]),10*eps);
  % !error spinv( sparse( [1,1;1,1]   ) );
  % !error spinv( sparse( [0,0;0,1]   ) );
  % !error spinv( sparse( [0,0;0,1+i] ) );
--- 179,186 ----
  %% Note that the last four do not fail, but rather give a warning
  %% of a singular matrix, which is consistent with the full matrix
  %% behaviour. They are therefore disabled.. 
! %!testif HAVE_UMFPACK
! %! assert(spinv(sparse([1,1;1,1+i])),sparse([1-1i,1i;1i,-1i]),10*eps);
  % !error spinv( sparse( [1,1;1,1]   ) );
  % !error spinv( sparse( [0,0;0,1]   ) );
  % !error spinv( sparse( [0,0;0,1+i] ) );
***************
*** 629,650 ****
      gen_square_divop_tests
  
      cat >>$TESTS <<EOF
! 
%!assert(spdet(bs+speye(size(bs))),det(bf+eye(size(bf))),100*eps*abs(det(bf+eye(size(bf)))))
  
! %!test 
  %! [l,u]=splu(sparse([1,1;1,1]));
  %! assert(l*u,[1,1;1,1],10*eps);
  
! %!test
  %! [l,u]=splu(sparse([1,1;1,1+i]));
  %! assert(l,sparse([1,2,2],[1,1,2],1),10*eps);
  %! assert(u,sparse([1,1,2],[1,2,2],[1,1,1i]),10*eps);
  
! %!test ;# permuted LU
  %! [L,U] = splu(bs);
  %! assert(L*U,bs,1e-10);
  
! %!test ;# simple LU + row permutations
  %! [L,U,P] = splu(bs);
  %! assert(P'*L*U,bs,1e-10);
  %! # triangularity
--- 630,652 ----
      gen_square_divop_tests
  
      cat >>$TESTS <<EOF
! %!testif HAVE_UMFPACK
! %! 
assert(spdet(bs+speye(size(bs))),det(bf+eye(size(bf))),100*eps*abs(det(bf+eye(size(bf)))))
  
! %!testif HAVE_UMFPACK 
  %! [l,u]=splu(sparse([1,1;1,1]));
  %! assert(l*u,[1,1;1,1],10*eps);
  
! %!testif HAVE_UMFPACK
  %! [l,u]=splu(sparse([1,1;1,1+i]));
  %! assert(l,sparse([1,2,2],[1,1,2],1),10*eps);
  %! assert(u,sparse([1,1,2],[1,2,2],[1,1,1i]),10*eps);
  
! %!testif HAVE_UMFPACK ;# permuted LU
  %! [L,U] = splu(bs);
  %! assert(L*U,bs,1e-10);
  
! %!testif HAVE_UMFPACK ;# simple LU + row permutations
  %! [L,U,P] = splu(bs);
  %! assert(P'*L*U,bs,1e-10);
  %! # triangularity
***************
*** 653,659 ****
  %! [i,j,v]=spfind(U);
  %! assert(j-i>=0);
  
! %!test ;# simple LU + row/col permutations
  %! [L,U,P,Q] = splu(bs);
  %! assert(P'*L*U*Q',bs,1e-10);
  %! # triangularity
--- 655,661 ----
  %! [i,j,v]=spfind(U);
  %! assert(j-i>=0);
  
! %!testif HAVE_UMFPACK ;# simple LU + row/col permutations
  %! [L,U,P,Q] = splu(bs);
  %! assert(P'*L*U*Q',bs,1e-10);
  %! # triangularity
***************
*** 662,668 ****
  %! [i,j,v]=spfind(U);
  %! assert(j-i>=0);
  
! %!test ;# LU with fixed column permutation
  %! [L,U,P] = splu(bs,colamd(bs));
  %! assert(P'*L*U,bs,1e-10);
  %! # triangularity
--- 664,670 ----
  %! [i,j,v]=spfind(U);
  %! assert(j-i>=0);
  
! %!testif HAVE_UMFPACK ;# LU with fixed column permutation
  %! [L,U,P] = splu(bs,colamd(bs));
  %! assert(P'*L*U,bs,1e-10);
  %! # triangularity
***************
*** 671,677 ****
  %! [i,j,v]=spfind(U(:,colamd(bs)));
  %! assert(j-i>=0);
  
! %!test ;# LU with initial column permutation
  %! [L,U,P,Q] = splu(bs,colamd(bs));
  %! assert(P'*L*U*Q',bs,1e-10);
  %! # triangularity
--- 673,679 ----
  %! [i,j,v]=spfind(U(:,colamd(bs)));
  %! assert(j-i>=0);
  
! %!testif HAVE_UMFPACK ;# LU with initial column permutation
  %! [L,U,P,Q] = splu(bs,colamd(bs));
  %! assert(P'*L*U*Q',bs,1e-10);
  %! # triangularity
***************
*** 680,686 ****
  %! [i,j,v]=spfind(U);
  %! assert(j-i>=0);
  
! %!test ;# inverse
  %! assert(spinv(bs)*bs,sparse(eye(rows(bs))),1e-10);
  
  %!assert(bf\as',bf\af',100*eps);
--- 682,688 ----
  %! [i,j,v]=spfind(U);
  %! assert(j-i>=0);
  
! %!testif HAVE_UMFPACK ;# inverse
  %! assert(spinv(bs)*bs,sparse(eye(rows(bs))),1e-10);
  
  %!assert(bf\as',bf\af',100*eps);
***************
*** 693,703 ****
  # Cholesky tests
  gen_cholesky_tests() {
      cat >>$TESTS <<EOF
! %!assert(spchol(bs)'*spchol(bs),bs,1e-10);
! %!assert(splchol(bs)*splchol(bs)',bs,1e-10);
! %!assert(splchol(bs),spchol(bs)',1e-10);
  
! %!test ;# Return Partial Cholesky factorization
  %! [RS,PS] = spchol(bs);
  %! assert(RS'*RS,bs,1e-10);
  %! assert(PS,0);
--- 695,708 ----
  # Cholesky tests
  gen_cholesky_tests() {
      cat >>$TESTS <<EOF
! %!testif HAVE_CHOLMOD
! %! assert(spchol(bs)'*spchol(bs),bs,1e-10);
! %!testif HAVE_CHOLMOD 
! %! assert(splchol(bs)*splchol(bs)',bs,1e-10);
! %!testif HAVE_CHOLMOD
! %! assert(splchol(bs),spchol(bs)',1e-10);
  
! %!testif HAVE_CHOLMOD ;# Return Partial Cholesky factorization
  %! [RS,PS] = spchol(bs);
  %! assert(RS'*RS,bs,1e-10);
  %! assert(PS,0);
***************
*** 705,711 ****
  %! assert(LS*LS',bs,1e-10);
  %! assert(PS,0);
  
! %!test ;# Permuted Cholesky factorization
  %! [RS,PS,QS] = spchol(bs);
  %! assert(RS'*RS,QS*bs*QS',1e-10);
  %! assert(PS,0);
--- 710,716 ----
  %! assert(LS*LS',bs,1e-10);
  %! assert(PS,0);
  
! %!testif HAVE_CHOLMOD ;# Permuted Cholesky factorization
  %! [RS,PS,QS] = spchol(bs);
  %! assert(RS'*RS,QS*bs*QS',1e-10);
  %! assert(PS,0);
***************
*** 914,931 ****
  %!assert(pds\xs,sparse(pdf\xf,1),1e-10);
  %!assert(ls\xf,lf\xf,1e-10);
  %!assert(sparse(ls\xs),sparse(lf\xf),1e-10);
! %!assert(pls\xf,plf\xf,1e-10);
! %!assert(sparse(pls\xs),sparse(plf\xf),1e-10);
  %!assert(us\xf,uf\xf,1e-10);
  %!assert(sparse(us\xs),sparse(uf\xf),1e-10);
! %!assert(pus\xf,puf\xf,1e-10);
! %!assert(sparse(pus\xs),sparse(puf\xf),1e-10);
  %!assert(bs\xf,bf\xf,1e-10);
  %!assert(sparse(bs\xs),sparse(bf\xf),1e-10);
! %!assert(cs\xf,cf\xf,1e-10);
! %!assert(sparse(cs\xs),sparse(cf\xf),1e-10);
! %!assert(bcs\xf,bcf\xf,1e-10);
! %!assert(sparse(bcs\xs),sparse(bcf\xf),1e-10);
  %!assert(ts\xf,tf\xf,1e-10);
  %!assert(sparse(ts\xs),sparse(tf\xf),1e-10);
  %!assert(tcs\xf,tcf\xf,1e-10);
--- 919,944 ----
  %!assert(pds\xs,sparse(pdf\xf,1),1e-10);
  %!assert(ls\xf,lf\xf,1e-10);
  %!assert(sparse(ls\xs),sparse(lf\xf),1e-10);
! %!testif HAVE_UMFPACK
! %! assert(pls\xf,plf\xf,1e-10);
! %!testif HAVE_UMFPACK
! %! assert(sparse(pls\xs),sparse(plf\xf),1e-10);
  %!assert(us\xf,uf\xf,1e-10);
  %!assert(sparse(us\xs),sparse(uf\xf),1e-10);
! %!testif HAVE_UMFPACK
! %! assert(pus\xf,puf\xf,1e-10);
! %!testif HAVE_UMFPACK
! %! assert(sparse(pus\xs),sparse(puf\xf),1e-10);
  %!assert(bs\xf,bf\xf,1e-10);
  %!assert(sparse(bs\xs),sparse(bf\xf),1e-10);
! %!testif HAVE_UMFPACK
! %! assert(cs\xf,cf\xf,1e-10);
! %!testif HAVE_UMFPACK
! %! assert(sparse(cs\xs),sparse(cf\xf),1e-10);
! %!testif HAVE_UMFPACK
! %! assert(bcs\xf,bcf\xf,1e-10);
! %!testif HAVE_UMFPACk
! %! assert(sparse(bcs\xs),sparse(bcf\xf),1e-10);
  %!assert(ts\xf,tf\xf,1e-10);
  %!assert(sparse(ts\xs),sparse(tf\xf),1e-10);
  %!assert(tcs\xf,tcf\xf,1e-10);
***************
*** 945,951 ****
  %! assert (sparse(a * x), b, feps);
  %! b = sprandn(sz(1),sz(2),0.2)+1i*sprandn(sz(1),sz(2),0.2); x = a \b; 
  %! assert (sparse(a * x), b, feps);
! %!test
  %! a = alpha*sprandn(10,11,0.2)+speye(10,11); f(a,[10,2],1e-10);
  %! ## Test this by forcing matrix_type, as can't get a certain 
  %! ## result for over-determined systems.
--- 958,964 ----
  %! assert (sparse(a * x), b, feps);
  %! b = sprandn(sz(1),sz(2),0.2)+1i*sprandn(sz(1),sz(2),0.2); x = a \b; 
  %! assert (sparse(a * x), b, feps);
! %!testif HAVE_CXSPARSE
  %! a = alpha*sprandn(10,11,0.2)+speye(10,11); f(a,[10,2],1e-10);
  %! ## Test this by forcing matrix_type, as can't get a certain 
  %! ## result for over-determined systems.
***************
*** 980,1007 ****
  %!assert(pds\xs,sparse(pdf\xs,true),100*eps)
  %!test
  %! us = alpha*[[speye(10,10);sparse(1,10)],[[1,1];sparse(9,2);[1,1]]];
! %!assert(us*(us\xf),xf,100*eps)
! %!assert(us*(us\xs),xs,100*eps)
  %!test
  %! pus = us(:,[2,1,3:12]);
! %!assert(pus*(pus\xf),xf,100*eps)
! %!assert(pus*(pus\xs),xs,100*eps)
  %!test
  %! us = alpha*[speye(11,9),[1;sparse(8,1);1;0]];
! %!test
  %! [c,r] = spqr (us, xf);
  %! assert(us\xf,r\c,100*eps)
! %!test
  %! [c,r] = spqr (us, xs);
  %! r = matrix_type(r,"Singular"); ## Force Matrix Type
  %! assert(us\xs,r\c,100*eps)
  %!test
  %! pus = us(:,[1:8,10,9]);
! %!test
  %! [c,r] = spqr (pus, xf);
  %! r = matrix_type(r,"Singular"); ## Force Matrix Type
  %! assert(pus\xf,r\c,100*eps)
! %!test
  %! [c,r] = spqr (pus, xs);
  %! r = matrix_type(r,"Singular"); ## Force Matrix Type
  %! assert(pus\xs,r\c,100*eps)
--- 993,1024 ----
  %!assert(pds\xs,sparse(pdf\xs,true),100*eps)
  %!test
  %! us = alpha*[[speye(10,10);sparse(1,10)],[[1,1];sparse(9,2);[1,1]]];
! %!testif HAVE_UMFPACK
! %! assert(us*(us\xf),xf,100*eps)
! %!testif HAVE_UMFPACK
! %! assert(us*(us\xs),xs,100*eps)
  %!test
  %! pus = us(:,[2,1,3:12]);
! %!testif HAVE_UMFPACK
! %! assert(pus*(pus\xf),xf,100*eps)
! %!testif HAVE_UMFPACK
! %! assert(pus*(pus\xs),xs,100*eps)
  %!test
  %! us = alpha*[speye(11,9),[1;sparse(8,1);1;0]];
! %!testif HAVE_CXSPARSE
  %! [c,r] = spqr (us, xf);
  %! assert(us\xf,r\c,100*eps)
! %!testif HAVE_CXSPARSE
  %! [c,r] = spqr (us, xs);
  %! r = matrix_type(r,"Singular"); ## Force Matrix Type
  %! assert(us\xs,r\c,100*eps)
  %!test
  %! pus = us(:,[1:8,10,9]);
! %!testif HAVE_CXSPARSE
  %! [c,r] = spqr (pus, xf);
  %! r = matrix_type(r,"Singular"); ## Force Matrix Type
  %! assert(pus\xf,r\c,100*eps)
! %!testif HAVE_CXSPARSE
  %! [c,r] = spqr (pus, xs);
  %! r = matrix_type(r,"Singular"); ## Force Matrix Type
  %! assert(pus\xs,r\c,100*eps)
***************
*** 1019,1038 ****
  %! ls = alpha*[speye(10,10),sparse(10,1);[1;1],sparse(2,9),[1;1]];
  %! xf = beta * ones(12,2);
  %! xs = speye(12,12);
! %!test
  %! [c,r] = spqr (ls, xf);
  %! assert(ls\xf,r\c,100*eps)
! %!test
  %! [c,r] = spqr (ls, xs);
  %! r = matrix_type(r,"Singular"); ## Force Matrix Type
  %! assert(ls\xs,r\c,100*eps)
! %!test
  %! pls = ls(:,[1:8,10,9]);
! %!test
  %! [c,r] = spqr (pls, xf);
  %! r = matrix_type(r,"Singular"); ## Force Matrix Type
  %! assert(pls\xf,r\c,100*eps)
! %!test
  %! [c,r] = spqr (pls, xs);
  %! r = matrix_type(r,"Singular"); ## Force Matrix Type
  %! assert(pls\xs,r\c,100*eps)
--- 1036,1055 ----
  %! ls = alpha*[speye(10,10),sparse(10,1);[1;1],sparse(2,9),[1;1]];
  %! xf = beta * ones(12,2);
  %! xs = speye(12,12);
! %!testif HAVE_CXSPARSE
  %! [c,r] = spqr (ls, xf);
  %! assert(ls\xf,r\c,100*eps)
! %!testif HAVE_CXSPARSE
  %! [c,r] = spqr (ls, xs);
  %! r = matrix_type(r,"Singular"); ## Force Matrix Type
  %! assert(ls\xs,r\c,100*eps)
! %!testif HAVE_CXSPARSE
  %! pls = ls(:,[1:8,10,9]);
! %!testif HAVE_CXSPARSE
  %! [c,r] = spqr (pls, xf);
  %! r = matrix_type(r,"Singular"); ## Force Matrix Type
  %! assert(pls\xf,r\c,100*eps)
! %!testif HAVE_CXSPARSE
  %! [c,r] = spqr (pls, xs);
  %! r = matrix_type(r,"Singular"); ## Force Matrix Type
  %! assert(pls\xs,r\c,100*eps)
Index: test/fntests.m
===================================================================
RCS file: /usr/local/cvsroot/octave/test/fntests.m,v
retrieving revision 1.12
diff -c -r1.12 fntests.m
*** test/fntests.m      12 Oct 2007 06:41:25 -0000      1.12
--- test/fntests.m      4 Dec 2007 01:31:18 -0000
***************
*** 76,86 ****
         || findstr (str, "%!error") || findstr (str, "%!warning"));
  endfunction
  
! function [dp, dn, dxf] = run_test_dir (fid, d);
    global files_with_tests;
    global files_with_no_tests;
    lst = dir (d);
!   dp = dn = dxf = 0;
    for i = 1:length (lst)
      nm = lst(i).name;
      if (length (nm) > 5 && strcmp (nm(1:5), "test_")
--- 76,86 ----
         || findstr (str, "%!error") || findstr (str, "%!warning"));
  endfunction
  
! function [dp, dn, dxf, dsk] = run_test_dir (fid, d);
    global files_with_tests;
    global files_with_no_tests;
    lst = dir (d);
!   dp = dn = dxf = dsk = 0;
    for i = 1:length (lst)
      nm = lst(i).name;
      if (length (nm) > 5 && strcmp (nm(1:5), "test_")
***************
*** 89,95 ****
        ffnm = fullfile (d, nm);
        if (hastests (ffnm))
        print_test_file_name (nm);
!       [p, n, xf] = test (nm(1:(end-2)), "quiet", fid);
        print_pass_fail (n, p);
        files_with_tests(end+1) = ffnm;
        else
--- 89,95 ----
        ffnm = fullfile (d, nm);
        if (hastests (ffnm))
        print_test_file_name (nm);
!       [p, n, xf, sk] = test (nm(1:(end-2)), "quiet", fid);
        print_pass_fail (n, p);
        files_with_tests(end+1) = ffnm;
        else
***************
*** 98,122 ****
        dp += p;
        dn += n;
        dxf += xf;
      endif
    endfor
  endfunction
  
! function [dp, dn, dxf] = run_test_script (fid, d);
    global files_with_tests;
    global files_with_no_tests;
    global topsrcdir;
    global topbuilddir;
    lst = dir (d);
!   dp = dn = dxf = 0;
    for i = 1:length (lst)
      nm = lst(i).name;
      if (lst(i).isdir && ! strcmp (nm, ".") && ! strcmp (nm, "..")
        && ! strcmp (nm, "CVS"))
!       [p, n, xf] = run_test_script (fid, [d, "/", nm]);
        dp += p;
        dn += n;
        dxf += xf;
      endif
    endfor
    for i = 1:length (lst)
--- 98,124 ----
        dp += p;
        dn += n;
        dxf += xf;
+       dsk += sk;
      endif
    endfor
  endfunction
  
! function [dp, dn, dxf, dsk] = run_test_script (fid, d);
    global files_with_tests;
    global files_with_no_tests;
    global topsrcdir;
    global topbuilddir;
    lst = dir (d);
!   dp = dn = dxf = dsk = 0;
    for i = 1:length (lst)
      nm = lst(i).name;
      if (lst(i).isdir && ! strcmp (nm, ".") && ! strcmp (nm, "..")
        && ! strcmp (nm, "CVS"))
!       [p, n, xf, sk] = run_test_script (fid, [d, "/", nm]);
        dp += p;
        dn += n;
        dxf += xf;
+       dsk += sk;
      endif
    endfor
    for i = 1:length (lst)
***************
*** 130,140 ****
        tmp = strrep (f, [topsrcdir, "/"], "");
        tmp = strrep (tmp, [topbuilddir, "/"], "../");
        print_test_file_name (tmp);
!       [p, n, xf] = test (f, "quiet", fid);
        print_pass_fail (n, p);
        dp += p;
        dn += n;
        dxf += xf;
        files_with_tests(end+1) = f;
        else
        files_with_no_tests(end+1) = f;
--- 132,143 ----
        tmp = strrep (f, [topsrcdir, "/"], "");
        tmp = strrep (tmp, [topbuilddir, "/"], "../");
        print_test_file_name (tmp);
!       [p, n, xf, sk] = test (f, "quiet", fid);
        print_pass_fail (n, p);
        dp += p;
        dn += n;
        dxf += xf;
+       dsk += sk;
        files_with_tests(end+1) = f;
        else
        files_with_no_tests(end+1) = f;
***************
*** 171,190 ****
      error ("could not open fntests.log for writing");
    endif
    test ("", "explain", fid);
!   dp = dn = dxf = 0;
    printf ("\nIntegrated test scripts:\n\n");
    for i = 1:length (fundirs)
!     [p, n, xf] = run_test_script (fid, fundirs{i});
      dp += p;
      dn += n;
      dxf += xf;
    endfor
    printf ("\nFixed test scripts:\n\n");
    for i = 1:length (testdirs)
!     [p, n, xf] = run_test_dir (fid, testdirs{i});
      dp += p;
      dn += n;
      dxf += xf;
    endfor
    printf ("\nSummary:\n\n  PASS %6d\n", dp);
    nfail = dn - dp;
--- 174,195 ----
      error ("could not open fntests.log for writing");
    endif
    test ("", "explain", fid);
!   dp = dn = dxf = dsk = 0;
    printf ("\nIntegrated test scripts:\n\n");
    for i = 1:length (fundirs)
!     [p, n, xf, sk] = run_test_script (fid, fundirs{i});
      dp += p;
      dn += n;
      dxf += xf;
+     dsk += sk;
    endfor
    printf ("\nFixed test scripts:\n\n");
    for i = 1:length (testdirs)
!     [p, n, xf, sk] = run_test_dir (fid, testdirs{i});
      dp += p;
      dn += n;
      dxf += xf;
+     dsk += sk;
    endfor
    printf ("\nSummary:\n\n  PASS %6d\n", dp);
    nfail = dn - dp;
***************
*** 195,200 ****
--- 200,212 ----
      printf ("\nExpected failures are known bugs. Please help improve\n");
      printf ("Octave by contributing fixes for them.\n");
    endif
+   if (dsk > 0)
+     printf ("\nThere were %d skipped tests (see fntest.log for details).\n", 
dsk);
+     printf ("Skipped tests are features that are disabled in this version\n");
+     printf ("of Octave as the needed libraries were not present when 
Octave\n");
+     printf ("was built\n");
+   endif
+ 
    n_files_with_no_tests = length (files_with_no_tests);
    n_files = n_files_with_no_tests + length (files_with_tests);
    printf ("\n%d (of %d) files have no tests.  Please help improve Octave 
by\n",
2007-12-03  David Bateman  <address@hidden>

        * testfun/test.m: Disable "testif" test block to avoid spurious
        skipped test for "make check". Avoid printing variables for
        skipped tests.

2007-12-03  David Bateman  <address@hidden>

        * DLD-FUNCTIONS/luinc.cc: Make tests conditional on HAVE_UMFPACK.
        * DLD-FUNCTIONS/spqr.cc: Make tests conditional on HAVE_CXSPARSE/

2007-12-03  David Bateman  <address@hidden>

        * fntests.m: Also count the skipped tests
        * buil_sparse_tests.sh: As appropriate make tests conditional on
        HAVE_UMFPACK, HAVE_CHOLMOD and HAVE_CXSPARSE.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]