From 83eff4866745ce8bea447f2ff64c436ee47be366 Mon Sep 17 00:00:00 2001 From: dkimitsa Date: Sat, 16 Jul 2022 16:24:04 +0300 Subject: [PATCH] * fixed tests and added tests for `` --- .../robovm/compiler/config/ConfigTest.java | 35 ++++++++++++++++--- .../compiler/config/ConfigTest.console.xml | 4 +++ .../robovm/compiler/config/ConfigTest.ios.xml | 4 +++ 3 files changed, 39 insertions(+), 4 deletions(-) diff --git a/compiler/compiler/src/test/java/org/robovm/compiler/config/ConfigTest.java b/compiler/compiler/src/test/java/org/robovm/compiler/config/ConfigTest.java index 9b190c82b..4cc992dae 100755 --- a/compiler/compiler/src/test/java/org/robovm/compiler/config/ConfigTest.java +++ b/compiler/compiler/src/test/java/org/robovm/compiler/config/ConfigTest.java @@ -18,10 +18,7 @@ import static org.junit.Assert.*; -import java.io.File; -import java.io.IOException; -import java.io.InputStreamReader; -import java.io.StringWriter; +import java.io.*; import java.util.Arrays; import java.util.Collections; @@ -418,4 +415,34 @@ public void testGetFileName() throws Exception { assertEquals("com/example/AB9ca44297c0e0d22df654119dce73ee52d3d51c71.class.o", Config.getFileName("com/example/ABCDEFGIHJABCDEFGIHJABCDEFGIHJABCDEFGIHJABCDEFGIHJ", "class.o", 50)); } + + @Test + public void testSwiftSupportEnabledByDefault() throws Exception { + String configText = "\n" + + " ios\n" + + ""; + Config.Builder builder = new Config.Builder(); + + builder.read(new StringReader(configText), wd); + Config config = builder.config; + + assertTrue(config.hasSwiftSupport()); + assertNotNull(config.getSwiftSupport()); + assertTrue(config.getSwiftSupport().isEnabled()); + assertTrue(config.getSwiftSupport().shouldCopySwiftLibs()); + } + + @Test + public void testSwiftSupportCanBeDisabled() throws Exception { + String configText = "\n" + + " \n" + + " false\n" + + " \n" + + ""; + Config.Builder builder = new Config.Builder(); + builder.read(new StringReader(configText), wd); + Config config = builder.config; + assertFalse(config.hasSwiftSupport()); + assertNull(config.getSwiftSupport()); + } } diff --git a/compiler/compiler/src/test/resources/org/robovm/compiler/config/ConfigTest.console.xml b/compiler/compiler/src/test/resources/org/robovm/compiler/config/ConfigTest.console.xml index d2d815286..c05986389 100644 --- a/compiler/compiler/src/test/resources/org/robovm/compiler/config/ConfigTest.console.xml +++ b/compiler/compiler/src/test/resources/org/robovm/compiler/config/ConfigTest.console.xml @@ -15,6 +15,10 @@ Foundation AppKit + + true + true + resources /usr/share/resources diff --git a/compiler/compiler/src/test/resources/org/robovm/compiler/config/ConfigTest.ios.xml b/compiler/compiler/src/test/resources/org/robovm/compiler/config/ConfigTest.ios.xml index a481d9881..48fa38450 100644 --- a/compiler/compiler/src/test/resources/org/robovm/compiler/config/ConfigTest.ios.xml +++ b/compiler/compiler/src/test/resources/org/robovm/compiler/config/ConfigTest.ios.xml @@ -1,4 +1,8 @@ + + true + true + ios 6.1 Info.plist