Skip to content

Commit

Permalink
Add Gametests only to gametest run configurations
Browse files Browse the repository at this point in the history
  • Loading branch information
2No2Name committed Dec 16, 2024
1 parent 5739aa6 commit 8fcc6a3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions neoforge/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,15 @@ neoForge {

sourceSet = sourceSets.getByName("gametest")
systemProperty("neoforge.enabledGameTestNamespaces", "lithium-gametest")
environment("LITHIUM_GAMETEST_RESOURCES", file("src/gametest/resources").path)
environment("LITHIUM_GAMETEST_RESOURCES", file("../../../common/src/gametest/resources/data/lithium-gametest/gametest/structure").path)
}
create("gametestServer") {
type = "gameTestServer"
gameDirectory.set(file("runs/gametestServer"))

sourceSet = sourceSets.getByName("gametest")
systemProperty("neoforge.enabledGameTestNamespaces", "lithium-gametest")
environment("LITHIUM_GAMETEST_RESOURCES", file("src/gametest/resources").path)
environment("LITHIUM_GAMETEST_RESOURCES", file("../../../common/src/gametest/resources/data/lithium-gametest/gametest/structure").path)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
@GameTestHolder("lithium-gametest")
public class LithiumNeoforgeGameTest {

//Not very nice to do this but it works
public static final String LITHIUM_GAMETEST_SNBT_PATH = "../../../common/src/gametest/resources/data/lithium-gametest/gametest/structure";
public static final String LITHIUM_GAMETEST_SNBT_PATH = System.getenv("LITHIUM_GAMETEST_RESOURCES");

//Some tests are excluded because Neoforge is breaking them, not lithium.
//test_redstone.lava_push_speed broken by https://github.com/neoforged/NeoForge/issues/1575
Expand Down Expand Up @@ -113,6 +112,10 @@ private static Optional<BlockPos> checkFailureBlocks(GameTestHelper gameTestHelp

@GameTestGenerator
public Collection<TestFunction> getAllRedstoneTests() {
if (LITHIUM_GAMETEST_SNBT_PATH == null) {
return List.of();
}

List<String> structureNames = null;
try {
structureNames = getLithiumSNBTFilenames();
Expand Down

0 comments on commit 8fcc6a3

Please sign in to comment.