From b3e889fa11d3cdd09aba06aded103f81dcdebf37 Mon Sep 17 00:00:00 2001 From: Alexey Andreev Date: Sun, 26 Nov 2023 22:05:23 +0100 Subject: [PATCH] junit: fix compiling tests for platforms which don't participate in testing --- .../src/main/java/org/teavm/junit/TeaVMTestRunner.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/junit/src/main/java/org/teavm/junit/TeaVMTestRunner.java b/tools/junit/src/main/java/org/teavm/junit/TeaVMTestRunner.java index c354290f9..c2f3ea3a9 100644 --- a/tools/junit/src/main/java/org/teavm/junit/TeaVMTestRunner.java +++ b/tools/junit/src/main/java/org/teavm/junit/TeaVMTestRunner.java @@ -110,7 +110,7 @@ public class TeaVMTestRunner extends Runner implements Filterable { platforms.add(new CPlatformSupport(classSource, referenceCache)); for (var platform : platforms) { - if (platform.isEnabled()) { + if (platform.isEnabled() && !platform.getConfigurations().isEmpty()) { var runStrategy = platform.createRunStrategy(outputDir); if (runStrategy != null) { runners.put(platform.getPlatform(), runStrategy); @@ -148,7 +148,7 @@ public class TeaVMTestRunner extends Runner implements Filterable { @Override public void run(RunNotifier notifier) { for (var platform : platforms) { - if (!platform.getConfigurations().isEmpty()) { + if (platform.isEnabled() && !platform.getConfigurations().isEmpty()) { participatingPlatforms.add(platform); } } @@ -228,7 +228,7 @@ public class TeaVMTestRunner extends Runner implements Filterable { @SuppressWarnings("unchecked") private boolean compileClassForPlatform(TestPlatformSupport platform, List children, Description description, RunNotifier notifier) { - if (hasChildrenToRun(children, platform.getPlatform())) { + if (platform.isEnabled() && hasChildrenToRun(children, platform.getPlatform())) { for (var configuration : platform.getConfigurations()) { var path = getOutputPathForClass(platform); var castPlatform = (TestPlatformSupport) platform; @@ -337,7 +337,7 @@ public class TeaVMTestRunner extends Runner implements Filterable { MethodReference reference = new MethodReference(child.getDeclaringClass().getName(), descriptor); for (var platform : participatingPlatforms) { - if (shouldRunChild(child, platform.getPlatform())) { + if (platform.isEnabled() && shouldRunChild(child, platform.getPlatform())) { var outputPath = getOutputPathForClass(platform); var outputPathForMethod = getOutputPath(child, platform); for (var configuration : platform.getConfigurations()) { @@ -357,7 +357,7 @@ public class TeaVMTestRunner extends Runner implements Filterable { try { for (var platform : participatingPlatforms) { - if (shouldRunChild(child, platform.getPlatform())) { + if (platform.isEnabled() && shouldRunChild(child, platform.getPlatform())) { File outputPath = getOutputPath(child, platform); for (var configuration : platform.getConfigurations()) { @SuppressWarnings("unchecked")