mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-10-11 19:14:11 +00:00
Share test fixtures across modules
- Move art.arcane.iris.testsupport into core/src/testFixtures and apply java-test-fixtures to core - Consume core test fixtures from the bukkit plugin, nms, probe and the three loader adapters - Delete the duplicate ProjectPaths copies in the bukkit-plugin and modded-common test trees - Point ModdedMessageContributorTest at the shared ProjectPaths - Guard CommandPackCompatTest, NativeTransitionColumnTest and StubPlatformStateTest with PlatformLeakGuard - Release the probe runtime state after DimensionStackSuperflatProbeTest opens a workspace - Keep core main classes ahead of the core jar on the test classpath so the bytecode gates still scan a directory
This commit is contained in:
@@ -17,6 +17,7 @@ dependencies {
|
||||
implementation(project(':core'))
|
||||
compileOnly(libs.spigot)
|
||||
testImplementation('junit:junit:4.13.2')
|
||||
testImplementation(testFixtures(project(':core')))
|
||||
testImplementation(volmLibCoordinate) {
|
||||
transitive = false
|
||||
}
|
||||
|
||||
@@ -4,6 +4,8 @@ import art.arcane.iris.engine.DimensionStackContext;
|
||||
import art.arcane.iris.engine.DimensionStackLayout;
|
||||
import art.arcane.iris.engine.framework.Engine;
|
||||
import art.arcane.iris.spi.PlatformBlockState;
|
||||
import art.arcane.iris.testsupport.IrisRuntimeState;
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.io.File;
|
||||
@@ -20,6 +22,11 @@ import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
public final class DimensionStackSuperflatProbeTest {
|
||||
@AfterClass
|
||||
public static void releaseProbeRuntime() {
|
||||
IrisRuntimeState.reset();
|
||||
}
|
||||
|
||||
private static final long SEED = 1_337L;
|
||||
private static final long ALTERNATE_SEED = 8_675_309L;
|
||||
private static final int WORLD_HEIGHT = 128;
|
||||
|
||||
@@ -4,9 +4,11 @@ import art.arcane.iris.engine.decorator.IrisSpeleothems;
|
||||
import art.arcane.iris.engine.object.IrisObjectRotation;
|
||||
import art.arcane.iris.spi.IrisPlatforms;
|
||||
import art.arcane.iris.spi.PlatformBlockState;
|
||||
import art.arcane.iris.testsupport.PlatformLeakGuard;
|
||||
import art.arcane.iris.util.project.hunk.Hunk;
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.ClassRule;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
@@ -15,9 +17,11 @@ import static org.junit.Assert.assertSame;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
public final class StubPlatformStateTest {
|
||||
@ClassRule
|
||||
public static final PlatformLeakGuard LEAK_GUARD = PlatformLeakGuard.clean();
|
||||
|
||||
@BeforeClass
|
||||
public static void bindPlatform() {
|
||||
IrisPlatforms.unbind();
|
||||
IrisPlatforms.bind(new StubPlatform());
|
||||
StubPlatform.bindGenerationStateHandlers();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user