bugGNU Octave - Bugs: bug #39703, test script with two outputs...

 
 

bug #39703: test script with two outputs doesn't run all tests

Submitter:  Dan Sebald <sebald>
Submitted:  Mon 05 Aug 2013 11:34:33 PM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  3 - Low Item Group:  None
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sun 24 Aug 2014 10:42:57 PM UTC, comment #2: 
Rik <rik5>
Group administrator
Wed 07 Aug 2013 03:08:52 PM UTC, comment #1: 

When %!shared variables are declared they are valid until the next %!shared declaration.  The test.m script doesn't know whether you used any of the shared variables or not, but it prints them out in case they were used and had a bearing on this particular test.  Normally, this is exactly what you want because the test format tends towards


%!shared x,y,z
%! ... declare x,y,z

%!assert (func (x), y);
%!test
%! tmp = func (x,y);
%! assert (tmp, z);


The %!assert or %!test block wouldn't make sense unless you also knew the value of the shared variables x,y, and z.  One could try to code a regular expression to see if any of the shared variables were used in the code snippet before printing them out, but this sounds like overkill.

Rik <rik5>
Group administrator
Mon 05 Aug 2013 11:34:33 PM UTC, original submission:  

I believe there might be a couple problems in test.m.  Here is the output of running the test script on the "interpft.m" file:


>> [N_success, MAX_success] = test("interpft")
  ***** assert (max (abs (imag (interpft ([1:8], 20)))), 0, 2*eps);
!!!!! test failed
assert (max (abs (imag (interpft ([1:8], 20)))),0,2 * eps) expected
0
but got
   2.2542e-15
maximum absolute error 2.25417e-15 exceeds tolerance 4.44089e-16
shared variables
  scalar structure containing the fields:

    n =  11
    y =

       1.00000 + 1.00000i
       1.38397 + 1.38397i
       2.38397 + 2.38397i
       3.00000 + 3.00000i
       4.11603 + 4.11603i
       3.11603 + 3.11603i

N_success = 0
MAX_success = 0


From the code in test.m, I believe that the test continues after a failure only if in batch mode.  But there doesn't seem a way to control batch mode from the option list; only by supplying an FID output argument.

However, one would think that the two output version should run all tests if it is going to indicate now many were successful out of the total number of tests.

Also, test.m is printing out shared variables in event of a failure.  Perhaps there is some cruft left in the code:


      ## Show the variable context.
      if (! strcmp (__type, "error") && ! strcmp (__type, "testif")
          && ! all (__shared == " "))
        fputs (__fid, "shared variables ");
        eval (sprintf ("fdisp(__fid,bundle(%s));", __shared));
        fflush (__fid);
      endif


The shared variables that are listed are for a previous test and haven't anything to do with the failed test, as far as I know.

Dan Sebald <sebald>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by sebald (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-08-24 rik5 StatusNone Fixed
        Open/ClosedOpen Closed
    2013-10-17 rik5 Priority5 - Normal 3 - Low

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code