Mercurial > octave
changeset 25231:e1024058833c stable
test: change remaining %!xtests into %!tests
* tar.m, zip.m, fminsearch.m: Change %!xtest into %!test. Add or update
FIXME comments in case tests fail on some systems.
* clf.m, speed.m: Change %!xtest into %!test.
author | Mike Miller <mtmiller@octave.org> |
---|---|
date | Thu, 12 Apr 2018 12:09:14 -0700 |
parents | 07bddddc5856 |
children | fd7f2108c991 |
files | scripts/miscellaneous/tar.m scripts/miscellaneous/zip.m scripts/optimization/fminsearch.m scripts/plot/util/clf.m scripts/testfun/speed.m |
diffstat | 5 files changed, 17 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/miscellaneous/tar.m Tue Apr 10 23:22:03 2018 -0500 +++ b/scripts/miscellaneous/tar.m Thu Apr 12 12:09:14 2018 -0700 @@ -86,7 +86,10 @@ endfunction -%!xtest +## FIXME: This test may fail if the tar command is not installed. If this +## test fails, it might be better to change it into a testif with a +## runtime condition on the tar program. +%!test %! ## test tar together with untar %! orig_dir = pwd (); %! unwind_protect
--- a/scripts/miscellaneous/zip.m Tue Apr 10 23:22:03 2018 -0500 +++ b/scripts/miscellaneous/zip.m Thu Apr 12 12:09:14 2018 -0700 @@ -87,7 +87,10 @@ endfunction -%!xtest +## FIXME: This test may fail if the zip or unzip command is not installed. +## If this test fails, it might be better to change it into a testif +## with a runtime condition on the zip and unzip programs. +%!test %! ## test zip together with unzip %! unwind_protect %! filename = tempname ();
--- a/scripts/optimization/fminsearch.m Tue Apr 10 23:22:03 2018 -0500 +++ b/scripts/optimization/fminsearch.m Thu Apr 12 12:09:14 2018 -0700 @@ -443,10 +443,10 @@ %!assert (fminsearch (@sin, 3, optimset ("MaxIter", 30)), 3*pi/2, 1e-4) -## The following test is for checking that fminsearch stops earlier with -## these settings. If the optimizer algorithm is changed it is allowed to -## fail. Just adapt the values to make it pass again. -%!xtest +## FIXME: The following test is for checking that fminsearch stops earlier +## with these settings. If the optimizer algorithm is changed, it +## may fail. Just adapt the values to make it pass again. +%!test %! x = fminsearch (@sin, 3, optimset ("MaxIter", 3, "Display", "none")); %! assert (x, 4.8750, 1e-4); %! x = fminsearch (@sin, 3, optimset ("MaxFunEvals", 18, "Display", "none"));
--- a/scripts/plot/util/clf.m Tue Apr 10 23:22:03 2018 -0500 +++ b/scripts/plot/util/clf.m Thu Apr 12 12:09:14 2018 -0700 @@ -111,7 +111,7 @@ %! close (hf); %! end_unwind_protect -%!xtest +%!test %! set (0, "defaultfigurevisible", "off"); %! hf = figure ("visible", "off"); %! unwind_protect
--- a/scripts/testfun/speed.m Tue Apr 10 23:22:03 2018 -0500 +++ b/scripts/testfun/speed.m Thu Apr 12 12:09:14 2018 -0700 @@ -414,11 +414,10 @@ %! disp ("This time, the for loop is done away with entirely."); %! disp ("Notice how much bigger the speedup is than in example 1."); -## FIXME: Tests are known to fail on operating systems with low resolution -## timers such as MinGW. Therefore, tests are made xtests so that false -## failures are not reported. However, it might be better to either +## FIXME: Tests may fail on operating systems with low resolution timers such +## as MinGW. If a failure is reported, it might be better to either ## force the tests to do more work, or use %!testif to check the OS. -%!xtest +%!test %! [order, n, T_f1, T_f2] = speed ("airy (x)", "x = rand (n, 10)", [100, 1000]); %! assert (isstruct (order)); %! assert (size (order), [1, 1]); @@ -430,7 +429,7 @@ %! assert (isnumeric (T_f2)); %! assert (length (T_f2) > 10); -%!xtest +%!test %! [order, n, T_f1, T_f2] = speed ("sum (x)", "", [100, 1000], "v = 0; for i = 1:length (x), v += x(i); endfor"); %! assert (isstruct (order)); %! assert (size (order), [1, 1]);