# HG changeset patch # User John W. Eaton # Date 1261797979 18000 # Node ID 9b3a100922a6a2500251000c988035bf70e5972e # Parent acd5e9df38f847419e10ef6aab7be5f9bc07f1ad fntests.m: use regexp instead of findstr and only recognize tests that are the first thing on a line diff -r acd5e9df38f8 -r 9b3a100922a6 test/ChangeLog --- a/test/ChangeLog Fri Dec 25 21:38:20 2009 -0500 +++ b/test/ChangeLog Fri Dec 25 22:26:19 2009 -0500 @@ -1,3 +1,8 @@ +2009-12-25 John W. Eaton + + * fntests.m (hastests): Use regexp instead of findstr and only + match tests that appear as the first thing on a line. + 2009-12-19 Rik * build_sparse_tests.sh: Use lognrnd instead of deprecated lognormal_rnd diff -r acd5e9df38f8 -r 9b3a100922a6 test/fntests.m --- a/test/fntests.m Fri Dec 25 21:38:20 2009 -0500 +++ b/test/fntests.m Fri Dec 25 22:26:19 2009 -0500 @@ -87,8 +87,8 @@ else str = fread (fid, "*char")'; fclose (fid); - y = (findstr (str, "%!test") || findstr (str, "%!assert") - || findstr (str, "%!error") || findstr (str, "%!warning")); + y = ! isempty (regexp (str, "^[ \t]*%!(test|assert|error|warning)", + "lineanchors")); endif endfunction @@ -101,7 +101,7 @@ nm = lst(i).name; if (length (nm) > 5 && strcmp (nm(1:5), "test_") && strcmp (nm((end-1):end), ".m")) - p = n = 0; + p = n = xf = sk = 0; ffnm = fullfile (d, nm); if (hastests (ffnm)) print_test_file_name (nm);