changeset 19403:29228fa3edba stable

improve reporting for __run_test_suite__ (bug #43732) * __run_test_suite__.m: Always initialize global file lists. Use absolute name for log file.
author John W. Eaton <jwe@octave.org>
date Sun, 30 Nov 2014 23:23:14 -0500
parents c490eac28bbb
children 3492b771c2e6
files scripts/testfun/__run_test_suite__.m
diffstat 1 files changed, 10 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/testfun/__run_test_suite__.m	Thu Nov 27 21:07:03 2014 +0100
+++ b/scripts/testfun/__run_test_suite__.m	Sun Nov 30 23:23:14 2014 -0500
@@ -31,8 +31,10 @@
     fcndirs = { liboctavetestdir, libinterptestdir, fcnfiledir };
     fixedtestdirs = { fixedtestdir };
   endif
-  global files_with_no_tests = {};
-  global files_with_tests = {};
+  global files_with_no_tests;
+  global files_with_tests;
+  files_with_no_tests = {};
+  files_with_tests = {};
   ## FIXME: These names don't really make sense if we are running
   ##        tests for an installed copy of Octave.
   global topsrcdir = fcnfiledir;
@@ -40,12 +42,13 @@
   pso = page_screen_output ();
   warn_state = warning ("query", "quiet");
   warning ("on", "quiet");
+  logfile = make_absolute_filename ("fntests.log");
   try
     page_screen_output (false);
     warning ("off", "Octave:deprecated-function");
-    fid = fopen ("fntests.log", "wt");
+    fid = fopen (logfile, "wt");
     if (fid < 0)
-      error ("could not open fntests.log for writing");
+      error ("could not open %s for writing", logfile);
     endif
     test ("", "explain", fid);
     dp = dn = dxf = dsk = 0;
@@ -76,7 +79,7 @@
       printf ("  SKIPPED %6d\n", dsk);
     endif
     puts ("\n");
-    puts ("See the file test/fntests.log for additional details.\n");
+    printf ("See the file %s for additional details.\n", logfile);
     if (dxf > 0)
       puts ("\n");
       puts ("Expected failures (listed as XFAIL above) are known bugs.\n");
@@ -99,8 +102,8 @@
 
     report_files_with_no_tests (files_with_tests, files_with_no_tests, ".m");
 
-    puts ("\nPlease help improve Octave by contributing tests for\n");
-    puts ("these files (see the list in the file fntests.log).\n\n");
+    puts ("\nPlease help improve Octave by contributing tests for these files\n");
+    printf ("(see the list in the file %s).\n\n", logfile);
 
     fprintf (fid, "\nFiles with no tests:\n\n%s",
                   list_in_columns (files_with_no_tests, 80));