mirror of
https://github.com/RoBaertschi/EnvironmentTech.git
synced 2025-04-19 23:03:28 +00:00
getting unittests to work, NEOFORGE ADD SOME PROPER DOCS PLS
This commit is contained in:
parent
ff00885682
commit
f3da2f5271
@ -34,6 +34,19 @@ base {
|
|||||||
|
|
||||||
java.toolchain.languageVersion = JavaLanguageVersion.of(21)
|
java.toolchain.languageVersion = JavaLanguageVersion.of(21)
|
||||||
|
|
||||||
|
sourceSets {
|
||||||
|
// Include resources generated by data generators.
|
||||||
|
main.configure {
|
||||||
|
resources {
|
||||||
|
srcDir("src/generated/resources")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
create("junit") {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//minecraft.accessTransformers.file rootProject.file("src/main/resources/META-INF/accesstransformer.cfg")
|
//minecraft.accessTransformers.file rootProject.file("src/main/resources/META-INF/accesstransformer.cfg")
|
||||||
//minecraft.accessTransformers.entry public net.minecraft.client.Minecraft textureManager # textureManager
|
//minecraft.accessTransformers.entry public net.minecraft.client.Minecraft textureManager # textureManager
|
||||||
|
|
||||||
@ -60,6 +73,7 @@ runs {
|
|||||||
|
|
||||||
create("junit") {
|
create("junit") {
|
||||||
junit(true)
|
junit(true)
|
||||||
|
unitTestSources(sourceSets["junit"])
|
||||||
}
|
}
|
||||||
|
|
||||||
create("client") {
|
create("client") {
|
||||||
@ -89,23 +103,12 @@ runs {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Include resources generated by data generators.
|
configurations["junitImplementation"].extendsFrom(configurations.implementation.get())
|
||||||
sourceSets.main.configure {
|
|
||||||
resources {
|
|
||||||
srcDir("src/generated/resources")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
sourceSets {
|
afterEvaluate {
|
||||||
test {
|
runs["junit"].modSources = runs["junit"].modSources.get().stream().filter { it != sourceSets.main }.toList()
|
||||||
java {
|
|
||||||
srcDir("src/test/java")
|
|
||||||
}
|
|
||||||
resources{ srcDir("src/test/resources")}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
// Specify the version of Minecraft to use.
|
// Specify the version of Minecraft to use.
|
||||||
// Depending on the plugin applied there are several options. We will assume you applied the userdev plugin as shown above.
|
// Depending on the plugin applied there are several options. We will assume you applied the userdev plugin as shown above.
|
||||||
@ -115,9 +118,25 @@ dependencies {
|
|||||||
// For all intends and purposes: You can treat this dependency as if it is a normal library you would use.
|
// For all intends and purposes: You can treat this dependency as if it is a normal library you would use.
|
||||||
implementation ("net.neoforged:neoforge:${neoVersion}")
|
implementation ("net.neoforged:neoforge:${neoVersion}")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Testing
|
// Testing
|
||||||
testImplementation(platform("org.junit:junit-bom:5.10.2"))
|
|
||||||
testImplementation("org.junit.jupiter:junit-jupiter-params")
|
sourceSets.getByName("junit") {
|
||||||
|
dependencies {
|
||||||
|
|
||||||
|
implementation(platform("org.junit:junit-bom:5.10.2"))
|
||||||
|
implementation("org.junit.jupiter:junit-jupiter-params")
|
||||||
|
runtimeOnly("org.junit.jupiter:junit-jupiter-engine")
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// "junitImplementation"(platform("org.junit:junit-bom:5.10.2"))
|
||||||
|
// "junitImplementation"("org.junit.jupiter:junit-jupiter-params")
|
||||||
|
// "junitRuntimeOnly"("org.junit.jupiter:junit-jupiter-engine")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Example mod dependency with JEI
|
// Example mod dependency with JEI
|
||||||
// The JEI API is declared for compile time use, while the full JEI artifact is used at runtime
|
// The JEI API is declared for compile time use, while the full JEI artifact is used at runtime
|
||||||
|
@ -0,0 +1,7 @@
|
|||||||
|
package robaertschi.environmenttech.unittest;
|
||||||
|
|
||||||
|
import net.neoforged.testframework.annotation.TestGroup;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
public class TestProgressBar {
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user