bugGNU Octave - Bugs: bug #44581, __run_test__ / make check failure...

 
 

bug #44581: __run_test__ / make check failure with __w2mpth__

Submitter:  John Donoghue <lostbard>
Submitted:  Thu 19 Mar 2015 08:59:05 PM UTC
   
 
Category:  None Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Regression
Status:  Fixed Assigned to:  philipnienhuis
Originator Name:  JohnD Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Sat 21 Mar 2015 11:19:59 AM UTC, comment #6: 

@Mike:
no discussion there, I agree. I just forgot to delete the tests (it's that simple :-) ).

Both tar.m and unpack.m only contain one test that calls tar.exe twice. I'm not sure all path options are fully explored there.

An alternative I considered initially is to make w2mpth.m a regular function in scripts/miscellaneous/ - but not just before 4.0.0 release.
The best thing to do at this point is to simply to comment out the tests.

On Linux I saw a FAIL due to _w2mpth_ while running "make check"; the FAIL is due to the ispc() stanza. So there's another reason to eliminate the tests: to avoid__w2mpth__ being run in the first place by test.m and friends.

Adapted title & operating system;

Pushed fix (http://hg.savannah.gnu.org/hgweb/octave/rev/0f2cbcb14a21)

Closing report

Philip Nienhuis <philipnienhuis>
Group Member
Sat 21 Mar 2015 02:05:17 AM UTC, comment #5: 

Btw, I have no opinion on whether private functions should be testable or not, only that there is no way to test them at this point so it is pointless to add %!tests to them.

The tests for whether this private function is working already exist, they are called "test tar" and "test unpack" on Windows :) IMHO those tests are testing this function already.

If this function were moved somewhere more general, such as canonicalize_file_name or other user-callable file functions, then it would make sense to add tests for the dir separator being converted to the native type properly.

Just my two cents.

Mike Miller <mtmiller>
Group Member
Fri 20 Mar 2015 07:38:05 AM UTC, comment #4: 

@JohnD:
Thanks for digging up; BTW, IIRC that's just one of the bug reports about it, there must be older ones. There were also one or more octave-maintainers & bug-octave ML threads on this subject, and maybe even in the [OctDev] (former octave-forge) ML.
IOW it is an old gripe.

ISTR this issue pops up every other year or so.

So, given the (in itself sensible) "consensus", does any one have a suggestion of where to move the tests to? There are two candidate functions.... :-)

Philip Nienhuis <philipnienhuis>
Group Member
Fri 20 Mar 2015 02:30:01 AM UTC, comment #3: 

I think the consensus, at least from the Octave core side, was to not include %!tests in private functions. Either test the function indirectly by testing the user-callable functions that use it, or move it out of a private directory.

Mike Miller <mtmiller>
Group Member
Thu 19 Mar 2015 11:04:24 PM UTC, comment #2: 

Thats what I thought it was.

There is this bug report https://savannah.gnu.org/bugs/?38776

John Donoghue <lostbard>
Group Member
Thu 19 Mar 2015 09:45:38 PM UTC, comment #1: 

That must be the "can't run tests in functions in private subdirs" issue (can't find the bug number right now).

The kludge to avoid it is to simply comment out the tests.
I'll do that tomorrow, there's another fix for _w2mpth_ (a typo somewhere).

Philip Nienhuis <philipnienhuis>
Group Member
Thu 19 Mar 2015 08:59:05 PM UTC, original submission:  

Running _run_tests_ on Windows 7 box with dev octave, the following failure occurs:


>>>>> processing C:\Octave\Octave-4.0.0-rc1\share\octave\4.0.0-rc1\m\miscellaneous\private\__w2mpth__.m
***** test
 if (ispc)
   assert (__w2mpth__ ('file.fil'), 'file.fil');
   assert (__w2mpth__ ('\file.fil'), '/file.fil');
   assert (__w2mpth__ ('G:\file.fil'), '/G/file.fil');
   assert (__w2mpth__ ('r:\subdir\file.fil'), '/r/subdir/file.fil');
   assert (__w2mpth__ ('relative\path\to\file.dat'),
                       'relative/path/to/file.dat')
 endif
!!!!! test failed
'__w2mpth__' undefined near line 4 column 12


John Donoghue <lostbard>
Group Member

 

(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 mtmiller (Posted a comment)
  • -email is unavailable- added by lostbard (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 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-03-21 philipnienhuis StatusNone Fixed
        Open/ClosedOpen Closed
        Operating SystemMicrosoft Windows Any
        Summarymxe-octave _run_test_ failure with _w2mpth_ _run_test_ / make check failure with _w2mpth_
    2015-03-19 philipnienhuis Assigned toNone philipnienhuis

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code