# HG changeset patch # User Mike Miller # Date 1523560154 25200 # Node ID e1024058833c614ac9bee2e3e5c57ad55a9e1d48 # Parent 07bddddc58567e5960a77b8a79e0790cbb6a24d8 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. diff -r 07bddddc5856 -r e1024058833c scripts/miscellaneous/tar.m --- 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 diff -r 07bddddc5856 -r e1024058833c scripts/miscellaneous/zip.m --- 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 (); diff -r 07bddddc5856 -r e1024058833c scripts/optimization/fminsearch.m --- 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")); diff -r 07bddddc5856 -r e1024058833c scripts/plot/util/clf.m --- 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 diff -r 07bddddc5856 -r e1024058833c scripts/testfun/speed.m --- 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]);