aboutsummaryrefslogtreecommitdiff
path: root/src/test/groovy
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/groovy')
-rw-r--r--src/test/groovy/net/fabricmc/loom/test/integration/FabricAPITest.groovy2
-rw-r--r--src/test/groovy/net/fabricmc/loom/test/util/GradleProjectTestTrait.groovy12
2 files changed, 12 insertions, 2 deletions
diff --git a/src/test/groovy/net/fabricmc/loom/test/integration/FabricAPITest.groovy b/src/test/groovy/net/fabricmc/loom/test/integration/FabricAPITest.groovy
index 16d1e30d..cbefa2e0 100644
--- a/src/test/groovy/net/fabricmc/loom/test/integration/FabricAPITest.groovy
+++ b/src/test/groovy/net/fabricmc/loom/test/integration/FabricAPITest.groovy
@@ -46,7 +46,7 @@ class FabricAPITest extends Specification implements GradleProjectTestTrait {
repo: "https://github.com/FabricMC/fabric.git",
commit: "fc40aa9d88e9457957bdf3f8cec9698846828cd3",
version: version,
- warningMode: "all" // TODO remove once api has updated to 0.10
+ patch: "fabric_api"
)
// Set the version to something constant
diff --git a/src/test/groovy/net/fabricmc/loom/test/util/GradleProjectTestTrait.groovy b/src/test/groovy/net/fabricmc/loom/test/util/GradleProjectTestTrait.groovy
index a04d8b5a..91a19b91 100644
--- a/src/test/groovy/net/fabricmc/loom/test/util/GradleProjectTestTrait.groovy
+++ b/src/test/groovy/net/fabricmc/loom/test/util/GradleProjectTestTrait.groovy
@@ -61,13 +61,23 @@ trait GradleProjectTestTrait {
return
}
- if (options["repo"]) {
+ if (options.repo) {
String repo = options.repo
String commit = options.commit
exec(projectDir, "git", "clone", repo, ".")
exec(projectDir, "git", "checkout", commit)
+ if (options.patch) {
+ def patchFile = new File("src/test/resources/patches/${options.patch}.patch")
+
+ if (!patchFile.exists()) {
+ throw new FileNotFoundException("Could not find patch file at: " + patchFile.absolutePath)
+ }
+
+ exec(projectDir, "git", "apply", patchFile.absolutePath)
+ }
+
return
}