aboutsummaryrefslogtreecommitdiff
path: root/src/test/groovy/net/fabricmc/loom
diff options
context:
space:
mode:
authormodmuss50 <modmuss50@gmail.com>2021-03-15 23:31:18 +0000
committerGitHub <noreply@github.com>2021-03-15 23:31:18 +0000
commite6ac2afc7b5eab82be0266774dc95e834d10d013 (patch)
tree09b2a7c359fc46a8ee525b6391392af2278955c9 /src/test/groovy/net/fabricmc/loom
parent7231b9e053a91e584d5a41591347fe8e2082913f (diff)
downloadarchitectury-loom-e6ac2afc7b5eab82be0266774dc95e834d10d013.tar.gz
architectury-loom-e6ac2afc7b5eab82be0266774dc95e834d10d013.tar.bz2
architectury-loom-e6ac2afc7b5eab82be0266774dc95e834d10d013.zip
Ensure outputs are reproducable across all OS's. (#363)
Diffstat (limited to 'src/test/groovy/net/fabricmc/loom')
-rw-r--r--src/test/groovy/net/fabricmc/loom/ReproducibleBuildTest.groovy8
-rw-r--r--src/test/groovy/net/fabricmc/loom/util/ProjectTestTrait.groovy1
2 files changed, 3 insertions, 6 deletions
diff --git a/src/test/groovy/net/fabricmc/loom/ReproducibleBuildTest.groovy b/src/test/groovy/net/fabricmc/loom/ReproducibleBuildTest.groovy
index cb1343ba..362899f8 100644
--- a/src/test/groovy/net/fabricmc/loom/ReproducibleBuildTest.groovy
+++ b/src/test/groovy/net/fabricmc/loom/ReproducibleBuildTest.groovy
@@ -28,13 +28,11 @@ import com.google.common.hash.HashCode
import com.google.common.hash.Hashing
import com.google.common.io.Files
import net.fabricmc.loom.util.ProjectTestTrait
-import spock.lang.IgnoreIf
import spock.lang.Specification
import spock.lang.Unroll
import static org.gradle.testkit.runner.TaskOutcome.SUCCESS
-@IgnoreIf({ os.windows }) // Linux and mac create the same files, im unsure why windows is different. Let me know if you have any ideas?
class ReproducibleBuildTest extends Specification implements ProjectTestTrait {
@Override
String name() {
@@ -48,11 +46,11 @@ class ReproducibleBuildTest extends Specification implements ProjectTestTrait {
then:
result.task(":build").outcome == SUCCESS
getOutputHash("fabric-example-mod-1.0.0.jar") == modHash
- getOutputHash("fabric-example-mod-1.0.0-sources.jar") == sourceHash
+ getOutputHash("fabric-example-mod-1.0.0-sources.jar") in sourceHash // Done for different line endings.
where:
gradle | modHash | sourceHash
- '6.8.3' | "ccd6aaff1b06df01e4dd8c08625b82c9" | "8bd590dc03b7dd0de3a4a7aeb431d4e8"
- '7.0-milestone-2' | "ccd6aaff1b06df01e4dd8c08625b82c9" | "8bd590dc03b7dd0de3a4a7aeb431d4e8"
+ '6.8.3' | "6132ffb4117adb7e258f663110552952" | ["be31766e6cafbe4ae3bca9e35ba63169", "7348b0bd87d36d7ec6f3bca9c2b66062"]
+ '7.0-milestone-2' | "6132ffb4117adb7e258f663110552952" | ["be31766e6cafbe4ae3bca9e35ba63169", "7348b0bd87d36d7ec6f3bca9c2b66062"]
}
String getOutputHash(String name) {
diff --git a/src/test/groovy/net/fabricmc/loom/util/ProjectTestTrait.groovy b/src/test/groovy/net/fabricmc/loom/util/ProjectTestTrait.groovy
index ecde3932..b81b26f0 100644
--- a/src/test/groovy/net/fabricmc/loom/util/ProjectTestTrait.groovy
+++ b/src/test/groovy/net/fabricmc/loom/util/ProjectTestTrait.groovy
@@ -26,7 +26,6 @@ package net.fabricmc.loom.util
import org.gradle.testkit.runner.BuildResult
import org.gradle.testkit.runner.GradleRunner
-import spock.lang.Shared
trait ProjectTestTrait {
static File gradleHome = File.createTempDir()