bugGNU Octave - Bugs: bug #60040, [octave forge] (io) "pkg test...

 
 

bug #60040: [octave forge] (io) "pkg test io" fails if no JRE is installed

Submitted by:  Markus Mützel <mmuetzel>
Submitted on:  Thu 11 Feb 2021 10:48:29 AM UTC  
 
Category:  Octave Forge Package Severity:  2 - Minor
Priority:  5 - Normal Item Group:  Unexpected Error or Warning
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  Closed
Release:  other Operating System:  Any

Add a New Comment (Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Tue 02 Mar 2021 09:32:55 PM UTC, comment #4: 

Ah, misinterpreted the syntax, thx.
I'll have a second try.

Philip Nienhuis <philipnienhuis>
Project Member
Tue 02 Mar 2021 02:13:30 PM UTC, comment #3: 

Philip, that looks like a step in the correct direction.
But additionally to checking whether Octave was built with Java support, you should probably also check if Java is available on run time.
See e.g. the BISTs in javaaddpath:
https://hg.savannah.gnu.org/hgweb/octave/file/aef9c5caedcd/scripts/java/javaaddpath.m#l108

%!testif HAVE_JAVA; usejava ("jvm")

I don't know if that syntax is available in all Octave versions you are targeting with the io package. If it is not, you might be able to use something like the following:

%!testif HAVE_JAVA
%! if (usejava ("jvm"))
%!   # test goes here
%! endif

AFAICT, the only difference would be that the test might show up in a different category in the statistics (PASS instead of SKIPPED).

Markus Mützel <mmuetzel>
Project Member
Fri 26 Feb 2021 03:39:18 PM UTC, comment #2: 

fromJSON had the same issue.

Fixed here:
http://hg.code.sf.net/p/octave/io/rev/1cd610143a92

I also changed the line endings in toJSON.m and fromJSON.m to "\n" in a separate cset.

Closing report.

Philip Nienhuis <philipnienhuis>
Project Member
Thu 11 Feb 2021 05:18:46 PM UTC, comment #1: 

Thanks for the report.

Probably some "if HAVE_JAVA" or so in the tests. I'll fix it soon.
It's not urgent, a wrong test rather than a bug in the function itself.

Philip Nienhuis <philipnienhuis>
Project Member
Thu 11 Feb 2021 10:48:29 AM UTC, original submission:  

Running `pkg test io` with the current release candidate (6.1.90) on Windows 10 fails for `toJSON`.

The output for the failing test is:

>> test toJSON
***** test  ## unknown class
obj = javaObject ("java.math.BigDecimal", 1.0);
  assert(toJSON(obj), '"[java.math.BigDecimal]"');
!!!!! test failed
unable to find Java Runtime Environment: software\javasoft\java runtime environment::CurrentVersion

The test should probably be skipped if no JRE is installed to get accurate test results.

CC'ing Philip as the package maintainer.

Markus Mützel <mmuetzel>
Project 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 mmuetzel (Submitted the item)
  • -email is unavailable- added by mmuetzel
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

     

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-02-26 philipnienhuis StatusNone => Fixed
        Open/ClosedOpen => Closed
    2021-02-11 mmuetzel Carbon-Copy- => Added philipnienhuis

    Back to the top


    Powered by Savane 3.5