comparison scripts/testfun/__run_test_suite__.m @ 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 523dd79ee726
children 9ef286208da1 446c46af4b42
comparison
equal deleted inserted replaced
19397:c490eac28bbb 19403:29228fa3edba
29 fcnfiledir = octave_config_info ("fcnfiledir"); 29 fcnfiledir = octave_config_info ("fcnfiledir");
30 if (nargin == 0) 30 if (nargin == 0)
31 fcndirs = { liboctavetestdir, libinterptestdir, fcnfiledir }; 31 fcndirs = { liboctavetestdir, libinterptestdir, fcnfiledir };
32 fixedtestdirs = { fixedtestdir }; 32 fixedtestdirs = { fixedtestdir };
33 endif 33 endif
34 global files_with_no_tests = {}; 34 global files_with_no_tests;
35 global files_with_tests = {}; 35 global files_with_tests;
36 files_with_no_tests = {};
37 files_with_tests = {};
36 ## FIXME: These names don't really make sense if we are running 38 ## FIXME: These names don't really make sense if we are running
37 ## tests for an installed copy of Octave. 39 ## tests for an installed copy of Octave.
38 global topsrcdir = fcnfiledir; 40 global topsrcdir = fcnfiledir;
39 global topbuilddir = testsdir; 41 global topbuilddir = testsdir;
40 pso = page_screen_output (); 42 pso = page_screen_output ();
41 warn_state = warning ("query", "quiet"); 43 warn_state = warning ("query", "quiet");
42 warning ("on", "quiet"); 44 warning ("on", "quiet");
45 logfile = make_absolute_filename ("fntests.log");
43 try 46 try
44 page_screen_output (false); 47 page_screen_output (false);
45 warning ("off", "Octave:deprecated-function"); 48 warning ("off", "Octave:deprecated-function");
46 fid = fopen ("fntests.log", "wt"); 49 fid = fopen (logfile, "wt");
47 if (fid < 0) 50 if (fid < 0)
48 error ("could not open fntests.log for writing"); 51 error ("could not open %s for writing", logfile);
49 endif 52 endif
50 test ("", "explain", fid); 53 test ("", "explain", fid);
51 dp = dn = dxf = dsk = 0; 54 dp = dn = dxf = dsk = 0;
52 puts ("\nIntegrated test scripts:\n\n"); 55 puts ("\nIntegrated test scripts:\n\n");
53 for i = 1:length (fcndirs) 56 for i = 1:length (fcndirs)
74 endif 77 endif
75 if (dsk > 0) 78 if (dsk > 0)
76 printf (" SKIPPED %6d\n", dsk); 79 printf (" SKIPPED %6d\n", dsk);
77 endif 80 endif
78 puts ("\n"); 81 puts ("\n");
79 puts ("See the file test/fntests.log for additional details.\n"); 82 printf ("See the file %s for additional details.\n", logfile);
80 if (dxf > 0) 83 if (dxf > 0)
81 puts ("\n"); 84 puts ("\n");
82 puts ("Expected failures (listed as XFAIL above) are known bugs.\n"); 85 puts ("Expected failures (listed as XFAIL above) are known bugs.\n");
83 puts ("Please help improve Octave by contributing fixes for them.\n"); 86 puts ("Please help improve Octave by contributing fixes for them.\n");
84 endif 87 endif
97 weed_idx = cellfun (@isempty, regexp (files_with_no_tests, '\<deprecated\>|\<private\>', 'once')); 100 weed_idx = cellfun (@isempty, regexp (files_with_no_tests, '\<deprecated\>|\<private\>', 'once'));
98 files_with_no_tests = files_with_no_tests(weed_idx); 101 files_with_no_tests = files_with_no_tests(weed_idx);
99 102
100 report_files_with_no_tests (files_with_tests, files_with_no_tests, ".m"); 103 report_files_with_no_tests (files_with_tests, files_with_no_tests, ".m");
101 104
102 puts ("\nPlease help improve Octave by contributing tests for\n"); 105 puts ("\nPlease help improve Octave by contributing tests for these files\n");
103 puts ("these files (see the list in the file fntests.log).\n\n"); 106 printf ("(see the list in the file %s).\n\n", logfile);
104 107
105 fprintf (fid, "\nFiles with no tests:\n\n%s", 108 fprintf (fid, "\nFiles with no tests:\n\n%s",
106 list_in_columns (files_with_no_tests, 80)); 109 list_in_columns (files_with_no_tests, 80));
107 fclose (fid); 110 fclose (fid);
108 111