changeset 27484:1dbe2d38673f

javachk.m: Update BIST tests for new behavior (bug #55429). * javachk.m: Condition regular BIST tests on HAVE_JAVA. Create a special BIST test to check behavior when Octave was not compiled with JAVA support. Use single quotes in BIST strings in order not to have to escape embedded double quotes.
author Rik <rik@octave.org>
date Fri, 11 Oct 2019 08:50:26 -0700
parents 94d278b130d1
children 1bbeb8aeb1cd
files scripts/java/javachk.m
diffstat 1 files changed, 13 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/java/javachk.m	Thu Oct 10 09:13:54 2019 -0700
+++ b/scripts/java/javachk.m	Fri Oct 11 08:50:26 2019 -0700
@@ -130,17 +130,24 @@
 endfunction
 
 
-%!test
+%!testif ; ! __octave_config_info__().build_features.JAVA
 %! msg = javachk ("desktop");
-%! assert (msg.message, "javachk: this function is not supported, Java feature \"desktop\" is not available");
+%! assert (msg.message, "javachk: this function is not supported, Octave was not compiled with Java support");
+%! assert (msg.identifier, "Octave:javachk:java-not-supported");
+
+%!testif HAVE_JAVA
+%! msg = javachk ("desktop");
+%! assert (msg.message, 'javachk: this function is not supported, Java feature "desktop" is not available');
 %! assert (msg.identifier, "Octave:javachk:feature-not-available");
-%!test
+
+%!testif HAVE_JAVA
 %! msg = javachk ("desktop", "Java DESKTOP");
-%! assert (msg.message, "javachk: Java DESKTOP is not supported, Java feature \"desktop\" is not available");
+%! assert (msg.message, 'javachk: Java DESKTOP is not supported, Java feature "desktop" is not available');
 %! assert (msg.identifier, "Octave:javachk:feature-not-available");
-%!test
+
+%!testif HAVE_JAVA
 %! msg = javachk ("nosuchfeature");
-%! assert (msg.message, "javachk: this function is not supported, Java feature \"nosuchfeature\" is not available");
+%! assert (msg.message, 'javachk: this function is not supported, Java feature "nosuchfeature" is not available');
 %! assert (msg.identifier, "Octave:javachk:feature-not-available");
 
 %!testif HAVE_JAVA; usejava ("jvm")