Skip to content

Commit

Permalink
Remove run related tests, different PR handles this.
Browse files Browse the repository at this point in the history
  • Loading branch information
marchermans committed May 13, 2024
1 parent eafd19a commit be890cd
Showing 1 changed file with 0 additions and 112 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,118 +12,6 @@ class ConfigurationTests extends BuilderBasedTestSpecification {
injectIntoAllProject = true;
}

def "a mod with a default run and without run dependencies does not have them in the classpath"() {
given:
def project = create("no_run_dep_results_in_no_entry", {
it.build("""
java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}
dependencies {
implementation 'net.neoforged:neoforge:+'
implementation 'org.jgrapht:jgrapht-core:+'
}
runs {
client {
modSources.add(project.getSourceSets().main)
}
}
""")
it.file("src/main/java/net/neoforged/gradle/userdev/FunctionalTests.java", """
package net.neoforged.gradle.userdev;
import net.minecraft.client.Minecraft;
public class FunctionalTests {
public static void main(String[] args) {
System.out.println(Minecraft.getInstance().getClass().toString());
}
}
""")
it.withToolchains()
})

when:
def run = project.run {
it.tasks('writeMinecraftClasspathClient')
}

then:


def neoFormDirectory = run.file('.gradle/configuration/neoForm')
def versionedNeoFormDirectory = neoFormDirectory.listFiles()[0];
def stepsDirectory = new File(versionedNeoFormDirectory, 'steps')
def targetDirectory = new File(stepsDirectory, 'writeMinecraftClasspathClient')
def classpathFile = new File(targetDirectory, 'classpath.txt')

run.task(':writeMinecraftClasspathClient').outcome == TaskOutcome.SUCCESS
classpathFile.exists()
!classpathFile.text.contains('jgrapht')
}

def "a mod with a default run and with run dependencies does have them in the classpath"() {
given:
def project = create("run_dep_results_in_entry", {
it.build("""
java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}
dependencies {
implementation 'net.neoforged:neoforge:+'
implementation 'org.jgrapht:jgrapht-core:+'
}
runs {
client {
modSources.add(project.getSourceSets().main)
dependencies {
runtime 'org.jgrapht:jgrapht-core:+'
}
}
}
""")
it.file("src/main/java/net/neoforged/gradle/userdev/FunctionalTests.java", """
package net.neoforged.gradle.userdev;
import net.minecraft.client.Minecraft;
public class FunctionalTests {
public static void main(String[] args) {
System.out.println(Minecraft.getInstance().getClass().toString());
}
}
""")
it.withToolchains()
})

when:
def run = project.run {
it.tasks('writeMinecraftClasspathClient')
}

then:


def neoFormDirectory = run.file('.gradle/configuration/neoForm')
def versionedNeoFormDirectory = neoFormDirectory.listFiles()[0];
def stepsDirectory = new File(versionedNeoFormDirectory, 'steps')
def targetDirectory = new File(stepsDirectory, 'writeMinecraftClasspathClient')
def classpathFile = new File(targetDirectory, 'classpath.txt')

run.task(':writeMinecraftClasspathClient').outcome == TaskOutcome.SUCCESS
classpathFile.exists()
classpathFile.text.contains('jgrapht')
}

def "a mod with userdev in the implementation configuration does not leak it"() {
given:
def project = create("userdev_in_implementation_does_not_leak", {
Expand Down

0 comments on commit be890cd

Please sign in to comment.