From 87dbbb39c748a273938d9a6f403ebfc43d07e5a5 Mon Sep 17 00:00:00 2001 From: Zdenek Zambersky Date: Mon, 16 Sep 2024 15:58:11 +0200 Subject: [PATCH 1/2] Ignore variations when JVM_OPTIONS is set --- src/org/testKitGen/TestInfoParser.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/org/testKitGen/TestInfoParser.java b/src/org/testKitGen/TestInfoParser.java index 93eb652d..1f0fada9 100644 --- a/src/org/testKitGen/TestInfoParser.java +++ b/src/org/testKitGen/TestInfoParser.java @@ -147,12 +147,14 @@ public TestInfo parse() { getElements(ti.getPlatformRequirementsList(), "platformRequirementsList", "platformRequirements", null, ti.getTestCaseName()); List variations = new ArrayList(); - getElements(variations, "variations", "variation", null, ti.getTestCaseName()); List listOfVars = new ArrayList(); - for (int i = 0; i < variations.size(); i++) { - String subTestName = ti.getTestCaseName() + "_" + i; - Variation var = parseVariation(subTestName, variations.get(i), ti.getPlatform(), ti.getPlatformRequirementsList()); - listOfVars.add(var); + if (System.getenv("JVM_OPTIONS") == null) { + getElements(variations, "variations", "variation", null, ti.getTestCaseName()); + for (int i = 0; i < variations.size(); i++) { + String subTestName = ti.getTestCaseName() + "_" + i; + Variation var = parseVariation(subTestName, variations.get(i), ti.getPlatform(), ti.getPlatformRequirementsList()); + listOfVars.add(var); + } } if (variations.size() == 0) { String subTestName = ti.getTestCaseName() + "_0"; From 165d1b0ba8c852881f341bb8b21b996f33a7584d Mon Sep 17 00:00:00 2001 From: Zdenek Zambersky Date: Wed, 18 Sep 2024 13:22:27 +0200 Subject: [PATCH 2/2] print message when variations are ignored --- src/org/testKitGen/TestInfoParser.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/org/testKitGen/TestInfoParser.java b/src/org/testKitGen/TestInfoParser.java index 1f0fada9..6a4b9428 100644 --- a/src/org/testKitGen/TestInfoParser.java +++ b/src/org/testKitGen/TestInfoParser.java @@ -155,6 +155,8 @@ public TestInfo parse() { Variation var = parseVariation(subTestName, variations.get(i), ti.getPlatform(), ti.getPlatformRequirementsList()); listOfVars.add(var); } + } else { + System.out.println("Warning: JVM_OPTIONS specified, ignoring variations for " + testCaseName + "."); } if (variations.size() == 0) { String subTestName = ti.getTestCaseName() + "_0";