From d10f277bd39bb5ac9bd48939c916de607fef8ace Mon Sep 17 00:00:00 2001 From: Leonid Mesnik Date: Fri, 23 Feb 2024 19:58:38 +0000 Subject: [PATCH] 8326006: Allow TEST_VM_FLAGLESS to set flagless mode Reviewed-by: tschatzl, ayang --- test/jtreg-ext/requires/VMProps.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/jtreg-ext/requires/VMProps.java b/test/jtreg-ext/requires/VMProps.java index 986e0ec14bb..12792181b61 100644 --- a/test/jtreg-ext/requires/VMProps.java +++ b/test/jtreg-ext/requires/VMProps.java @@ -652,14 +652,15 @@ public class VMProps implements Callable> { * Checks if we are in almost out-of-box configuration, i.e. the flags * which JVM is started with don't affect its behavior "significantly". * {@code TEST_VM_FLAGLESS} enviroment variable can be used to force this - * method to return true and allow any flags. + * method to return true or false and allow or reject any flags. * * @return true if there are no JVM flags */ private String isFlagless() { boolean result = true; - if (System.getenv("TEST_VM_FLAGLESS") != null) { - return "" + result; + String flagless = System.getenv("TEST_VM_FLAGLESS"); + if (flagless != null) { + return "" + "true".equalsIgnoreCase(flagless); } List allFlags = allFlags().toList();