# HG changeset patch # User Rik # Date 1326247833 28800 # Node ID 68fd9f95e1f92b82edf649ff8d6ba6ca2c2c9a10 # Parent c27491205e48fbb58151ecf672d8d04fc1147f57 Don't process comments in %!testif specifications. * test.m: Strip comments before processing testif specification line. * build_sparse_tests.sh: Make comments on %!testif lines look attractive. diff -r c27491205e48 -r 68fd9f95e1f9 scripts/testfun/test.m --- a/scripts/testfun/test.m Tue Jan 10 17:35:38 2012 -0800 +++ b/scripts/testfun/test.m Tue Jan 10 18:10:33 2012 -0800 @@ -457,7 +457,9 @@ elseif (strcmp (__type, "testif")) __e = regexp (__code, '.$', 'lineanchors', 'once'); - __feat = regexp (__code(1:__e), '\w+', 'match'); + ## Strip comment any comment from testif line before looking for features + __feat_line = strtok (__code(1:__e), '#%'); + __feat = regexp (__feat_line, '\w+', 'match'); __have_feat = strfind (octave_config_info ("DEFS"), __feat); if (any (cellfun ("isempty", __have_feat))) __xskip++; diff -r c27491205e48 -r 68fd9f95e1f9 test/build_sparse_tests.sh --- a/test/build_sparse_tests.sh Tue Jan 10 17:35:38 2012 -0800 +++ b/test/build_sparse_tests.sh Tue Jan 10 18:10:33 2012 -0800 @@ -646,11 +646,11 @@ %! 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 +%!testif HAVE_UMFPACK # permuted LU %! [L,U] = lu (bs); %! assert (L*U, bs, 1e-10); -%!testif HAVE_UMFPACK ;# simple LU + row permutations +%!testif HAVE_UMFPACK # simple LU + row permutations %! [L,U,P] = lu (bs); %! assert (P'*L*U, bs, 1e-10); %! # triangularity @@ -659,7 +659,7 @@ %! [i,j,v] = find (U); %! assert (j-i>=0); -%!testif HAVE_UMFPACK ;# simple LU + row/col permutations +%!testif HAVE_UMFPACK # simple LU + row/col permutations %! [L,U,P,Q] = lu (bs); %! assert (P'*L*U*Q', bs, 1e-10); %! # triangularity @@ -668,7 +668,7 @@ %! [i,j,v] = find (U); %! assert (j-i>=0); -%!testif HAVE_UMFPACK ;# LU with vector permutations +%!testif HAVE_UMFPACK # LU with vector permutations %! [L,U,P,Q] = lu (bs,'vector'); %! assert (L(P,:)*U(:,Q), bs, 1e-10); %! # triangularity @@ -677,7 +677,7 @@ %! [i,j,v] = find (U); %! assert (j-i>=0); -%!testif HAVE_UMFPACK ;# LU with scaling +%!testif HAVE_UMFPACK # LU with scaling %! [L,U,P,Q,R] = lu (bs); %! assert (R*P'*L*U*Q', bs, 1e-10); %! # triangularity @@ -686,7 +686,7 @@ %! [i,j,v] = find (U); %! assert (j-i>=0); -%!testif HAVE_UMFPACK ;# inverse +%!testif HAVE_UMFPACK # inverse %! assert (inv (bs)*bs, sparse (eye (rows (bs))), 1e-10); %!assert (bf\as', bf\af', 100*eps); @@ -706,7 +706,7 @@ %!testif HAVE_CHOLMOD %! assert (chol (bs,'lower'), chol (bs)', 1e-10); -%!testif HAVE_CHOLMOD ;# Return Partial Cholesky factorization +%!testif HAVE_CHOLMOD # Return Partial Cholesky factorization %! [RS,PS] = chol (bs); %! assert (RS'*RS, bs, 1e-10); %! assert (PS, 0); @@ -714,7 +714,7 @@ %! assert (LS*LS', bs, 1e-10); %! assert (PS, 0); -%!testif HAVE_CHOLMOD ;# Permuted Cholesky factorization +%!testif HAVE_CHOLMOD # Permuted Cholesky factorization %! [RS,PS,QS] = chol (bs); %! assert (RS'*RS, QS*bs*QS', 1e-10); %! assert (PS, 0); @@ -750,11 +750,11 @@ gen_matrixdiag_tests gen_matrixreshape_tests cat >>$TESTS <=0); -%!testif HAVE_UMFPACK ;# simple LU + row/col permutations +%!testif HAVE_UMFPACK # simple LU + row/col permutations %! [L,U,P,Q] = lu (bs); %! assert (P'*L*U*Q', bs, 1e-10); %! # triangularity @@ -772,7 +772,7 @@ %! [i,j,v] = find (U); %! assert (j-i>=0); -%!testif HAVE_UMFPACK ;# LU with vector permutations +%!testif HAVE_UMFPACK # LU with vector permutations %! [L,U,P,Q] = lu (bs,'vector'); %! assert (L (P,:)*U (:,Q), bs, 1e-10); %! # triangularity @@ -781,7 +781,7 @@ %! [i,j,v] = find (U); %! assert (j-i>=0); -%!testif HAVE_UMFPACK ;# LU with scaling +%!testif HAVE_UMFPACK # LU with scaling %! [L,U,P,Q,R] = lu (bs); %! assert (R*P'*L*U*Q', bs, 1e-10); %! # triangularity @@ -930,7 +930,7 @@ %! load (savefile, "as_save"); %! unlink (savefile); %! assert (as_save, sparse(af)); -%!testif HAVE_HDF5 # save hdf5 +%!testif HAVE_HDF5 # save hdf5 %! savefile = tmpnam (); %! as_save = as; %! save ("-hdf5", savefile, "bf", "as_save", "af");