aboutsummaryrefslogtreecommitdiff
path: root/src/test/groovy/net/fabricmc/loom
diff options
context:
space:
mode:
authorshedaniel <daniel@shedaniel.me>2021-09-18 15:28:28 +0800
committershedaniel <daniel@shedaniel.me>2021-09-18 15:28:28 +0800
commitdfba3a1dc312dce728a75f55e37d8c2f0ca044d8 (patch)
treeb4d4f3e665e0b88740d5ab34de1ee5398c738efc /src/test/groovy/net/fabricmc/loom
parent7f54808315df20baae2b9b737f34a08bd85f6f1e (diff)
downloadarchitectury-loom-dfba3a1dc312dce728a75f55e37d8c2f0ca044d8.tar.gz
architectury-loom-dfba3a1dc312dce728a75f55e37d8c2f0ca044d8.tar.bz2
architectury-loom-dfba3a1dc312dce728a75f55e37d8c2f0ca044d8.zip
Fix codestyle, add forge tests
Signed-off-by: shedaniel <daniel@shedaniel.me>
Diffstat (limited to 'src/test/groovy/net/fabricmc/loom')
-rw-r--r--src/test/groovy/net/fabricmc/loom/test/integration/forge/ForgeTest.groovy58
1 files changed, 58 insertions, 0 deletions
diff --git a/src/test/groovy/net/fabricmc/loom/test/integration/forge/ForgeTest.groovy b/src/test/groovy/net/fabricmc/loom/test/integration/forge/ForgeTest.groovy
new file mode 100644
index 00000000..28dfde1b
--- /dev/null
+++ b/src/test/groovy/net/fabricmc/loom/test/integration/forge/ForgeTest.groovy
@@ -0,0 +1,58 @@
+/*
+ * This file is part of fabric-loom, licensed under the MIT License (MIT).
+ *
+ * Copyright (c) 2021 FabricMC
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+package net.fabricmc.loom.test.integration.forge
+
+import net.fabricmc.loom.test.util.GradleProjectTestTrait
+import spock.lang.Specification
+import spock.lang.Unroll
+
+import static net.fabricmc.loom.test.LoomTestConstants.DEFAULT_GRADLE
+import static org.gradle.testkit.runner.TaskOutcome.SUCCESS
+
+class ForgeTest extends Specification implements GradleProjectTestTrait {
+ @Unroll
+ def "build #mcVersion #forgeVersion #mappings"() {
+ setup:
+ def gradle = gradleProject(project: "forge/simple", version: DEFAULT_GRADLE)
+ gradle.buildGradle.text = gradle.buildGradle.text.replace('@MCVERSION@', mcVersion)
+ .replace('@FORGEVERSION@', forgeVersion)
+ .replace('@MAPPINGS@', mappings)
+
+ when:
+ def result = gradle.run(task: "build", args: "")
+
+ then:
+ result.task(":build").outcome == SUCCESS
+
+ where:
+ mcVersion | forgeVersion | mappings
+ '1.17.1' | "37.0.67" | "loom.officialMojangMappings()"
+ '1.17.1' | "37.0.67" | "\"net.fabricmc:yarn:1.17.1+build.61:v2\""
+ '1.16.5' | "36.2.4" | "loom.officialMojangMappings()"
+ '1.16.5' | "36.2.4" | "\"net.fabricmc:yarn:1.16.5+build.5:v2\""
+ '1.14.4' | "28.2.23" | "loom.officialMojangMappings()"
+ '1.14.4' | "28.2.23" | "\"net.fabricmc:yarn:1.14.4+build.18:v2\""
+ }
+}