bugGNU Octave - Bugs: bug #55841, "__run_test_suite__ ({'.'},...

 
 

bug #55841: "__run_test_suite__ ({'.'}, {})" fails with "fnm(1): out of bound 0"

Submitter:  Colin Macdonald <cbm>
Submitted:  Wed 06 Mar 2019 02:59:47 AM UTC
   
 
Category:  Test Suite Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Regression
Status:  None Assigned to:  None
Originator Name:  Open/Closed:  * Open
Release:  * dev Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Wed 06 Mar 2019 08:29:23 PM UTC, comment #6: 

_run_test_suite_ is an internal function, as indicated by the leading and trailing underscores, so it does not do much in the way of input validation.  It expects to be called in the correct manner, which in this case is with absolute paths rather than relative ones.

Additional workarounds,


make_absolute_filename (".")
canonicalize_file_name (".")


Would be easy to write your own wrapper function that takes in cell arrays and then does


y = cellfun (@make_absolute_filename, x, "UniformOutput", false);


before passing to _run_test_suite_

Rik <rik5>
Group administrator
Wed 06 Mar 2019 05:34:50 PM UTC, comment #5: 

@cbm Using '__run_test_suite__ ({pwd}, {})' works for me, that's a workaround, but may not be suitable since the full path to each function file may make the output a lot messier.

Mike Miller <mtmiller>
Group Member
Wed 06 Mar 2019 05:30:34 PM UTC, comment #4: 

That is the sort of philosophical difference I was trying to point out.  It isn't that important, to me, that _run_test_suite_ doesn't work outside of its design envelope.

If it is useful to have a function that has features such as recursion, error summary, etc. then work should go in to creating that function (possibly by borrowing a lot of the _run_test_suite_ code as the core) rather than twisting _run_test_suite_ to do something it wasn't particularly designed for.

For a simple workaround, run with the full, rather than relative name to the current directory.  This syntax seems to work for me


__run_test_suite__ ({pwd()}, {})



Rik <rik5>
Group administrator
Wed 06 Mar 2019 05:09:30 PM UTC, comment #3: 

Unfortunately 'runtests' and '__run_test_suite__' provide very different functionality. Some users prefer the simpler output of 'runtests' with no summary, but also no recursion. Some users prefer the fuller features of '__run_test_suite__', including recursion, pass/fail summary, and a log file.

The fact is that we should have a way to provide these features in a public function, but '__run_test_suite__' is the only such function that users can call right now, and users have been using it in previous Octave releases to run their own test suites.

Mike Miller <mtmiller>
Group Member
Wed 06 Mar 2019 04:58:53 PM UTC, comment #2: 

The prototype for the function is


__run_test_suite__ (FCNDIRS, FIXEDTESTDIRS)


As a larger question, why is it important to support running the test suite without running the fixed tests?

If you have just made changes to a specific FILE, then run 'test FILE'.  If you have made several changes in a directory, let's say the image/ functions, then use 'runtests image'.

If you have made changes to something fundamental, say the interpreter, then you need to verify by running the entire suite including the fixed tests as well as the per-function tests.  This requires specifying the FIXEDTESTDIR directory.

Rik <rik5>
Group administrator
Wed 06 Mar 2019 03:02:09 AM UTC, comment #1: 

Likely a regression from d9d192928b45?

Colin Macdonald <cbm>
Wed 06 Mar 2019 02:59:47 AM UTC, original submission:  

Minimal example

octave:2> d = '.'
d = .
octave:3> [dnm, fnm] = fileparts (d)
dnm =
fnm =


Then fnm(1) fails because fnm is empty.

Colin Macdonald <cbm>

 

(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 cbm (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 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-03-06 mtmiller Carbon-CopyRemoved mtmiller -
    2019-03-06 cbm Carbon-Copy- Added mtmiller

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code