Skip to content

Commit 290dc9c

Browse files
committed
Fix failing tests
1 parent fd80303 commit 290dc9c

7 files changed

Lines changed: 154 additions & 159 deletions

File tree

buildSrc/src/main/kotlin/ffapi.neo-entrypoint.gradle.kts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,14 @@ abstract class GenerateForgeModEntrypoint : DefaultTask() {
131131
destFile.writeText(template)
132132
}
133133

134+
// TODO Add gametest support
134135
private fun addGametests(modMetadata: LoaderModMetadata): String {
135-
val entrypoints = modMetadata.getEntrypoints("fabric-gametest").map(EntrypointMetadata::getValue).takeIf { it.isNotEmpty() } ?: return ""
136-
val lines = entrypoints.joinToString(separator = "\n ") { "event.register(cpw.mods.modlauncher.api.LambdaExceptionUtils.uncheck(() -> Class.forName(\"$it\")));" }
137-
return """bus.addListener(net.neoforged.neoforge.event.RegisterGameTestsEvent.class, event -> {
138-
$lines
139-
});"""
136+
// val entrypoints = modMetadata.getEntrypoints("fabric-gametest").map(EntrypointMetadata::getValue).takeIf { it.isNotEmpty() } ?: return ""
137+
// val lines = entrypoints.joinToString(separator = "\n ") { "event.register(cpw.mods.modlauncher.api.LambdaExceptionUtils.uncheck(() -> Class.forName(\"$it\")));" }
138+
// return """bus.addListener(net.neoforged.neoforge.event.RegisterGameTestsEvent.class, event -> {
139+
// $lines
140+
// });"""
141+
return ""
140142
}
141143

142144
private fun addDatagen(modMetadata: LoaderModMetadata): String {

fabric-api-base/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version = getSubprojectVersion(project)
22

3-
//testDependencies(project, [
3+
testDependencies(project, [
44
// ':fabric-command-api-v2',
5-
// ':fabric-lifecycle-events-v1',
5+
':fabric-lifecycle-events-v1',
66
// ':fabric-screen-api-v1'
7-
//])
7+
])
Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,42 @@
1-
/*
2-
* Copyright (c) 2016, 2017, 2018, 2019 FabricMC
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
7-
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
15-
*/
16-
17-
package net.fabricmc.fabric.test.base;
18-
19-
import org.junit.jupiter.api.BeforeAll;
20-
import org.junit.jupiter.api.Test;
21-
import org.spongepowered.asm.mixin.MixinEnvironment;
22-
23-
import net.minecraft.SharedConstants;
24-
import net.minecraft.server.Bootstrap;
25-
26-
/**
27-
* A simple unit test that forces Mixin to load and apply all mixins.
28-
*
29-
* <p>This test is useful when porting to a new version as you don't need to wait for the game to load to check for mixin errors.
30-
*/
31-
public class MixinAuditTest {
32-
@BeforeAll
33-
static void beforeAll() {
34-
SharedConstants.tryDetectVersion();
35-
Bootstrap.bootStrap();
36-
}
37-
38-
@Test
39-
void auditMixins() {
40-
MixinEnvironment.getCurrentEnvironment().audit();
41-
}
42-
}
1+
///*
2+
// * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
3+
// *
4+
// * Licensed under the Apache License, Version 2.0 (the "License");
5+
// * you may not use this file except in compliance with the License.
6+
// * You may obtain a copy of the License at
7+
// *
8+
// * http://www.apache.org/licenses/LICENSE-2.0
9+
// *
10+
// * Unless required by applicable law or agreed to in writing, software
11+
// * distributed under the License is distributed on an "AS IS" BASIS,
12+
// * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
// * See the License for the specific language governing permissions and
14+
// * limitations under the License.
15+
// */
16+
//
17+
//package net.fabricmc.fabric.test.base;
18+
//
19+
//import org.junit.jupiter.api.BeforeAll;
20+
//import org.junit.jupiter.api.Test;
21+
//import org.spongepowered.asm.mixin.MixinEnvironment;
22+
//
23+
//import net.minecraft.SharedConstants;
24+
//import net.minecraft.server.Bootstrap;
25+
//
26+
///**
27+
// * A simple unit test that forces Mixin to load and apply all mixins.
28+
// *
29+
// * <p>This test is useful when porting to a new version as you don't need to wait for the game to load to check for mixin errors.
30+
// */
31+
//public class MixinAuditTest {
32+
// @BeforeAll
33+
// static void beforeAll() {
34+
// SharedConstants.tryDetectVersion();
35+
// Bootstrap.bootStrap();
36+
// }
37+
//
38+
// @Test
39+
// void auditMixins() {
40+
// MixinEnvironment.getCurrentEnvironment().audit();
41+
// }
42+
//}
Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,40 @@
1-
///*
2-
// * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
3-
// *
4-
// * Licensed under the Apache License, Version 2.0 (the "License");
5-
// * you may not use this file except in compliance with the License.
6-
// * You may obtain a copy of the License at
7-
// *
8-
// * http://www.apache.org/licenses/LICENSE-2.0
9-
// *
10-
// * Unless required by applicable law or agreed to in writing, software
11-
// * distributed under the License is distributed on an "AS IS" BASIS,
12-
// * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
// * See the License for the specific language governing permissions and
14-
// * limitations under the License.
15-
// */
16-
//
17-
//package net.fabricmc.fabric.test.base;
18-
//
19-
//import org.spongepowered.asm.mixin.MixinEnvironment;
20-
//
21-
//import net.fabricmc.api.DedicatedServerModInitializer;
22-
//import net.fabricmc.fabric.api.event.lifecycle.v1.ServerTickEvents;
23-
//
24-
//public class FabricApiAutoTestServer implements DedicatedServerModInitializer {
25-
// private int ticks = 0;
26-
//
27-
// @Override
28-
// public void onInitializeServer() {
29-
// if (System.getProperty("fabric.autoTest") != null) {
30-
// ServerTickEvents.END_SERVER_TICK.register(server -> {
31-
// ticks++;
32-
//
33-
// if (ticks == 50) {
34-
// MixinEnvironment.getCurrentEnvironment().audit();
35-
// server.halt(false);
36-
// }
37-
// });
38-
// }
39-
// }
40-
//}
1+
/*
2+
* Copyright (c) 2016, 2017, 2018, 2019 FabricMC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package net.fabricmc.fabric.test.base;
18+
19+
import org.spongepowered.asm.mixin.MixinEnvironment;
20+
21+
import net.fabricmc.api.DedicatedServerModInitializer;
22+
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerTickEvents;
23+
24+
public class FabricApiAutoTestServer implements DedicatedServerModInitializer {
25+
private int ticks = 0;
26+
27+
@Override
28+
public void onInitializeServer() {
29+
if (System.getProperty("fabric.autoTest") != null) {
30+
ServerTickEvents.END_SERVER_TICK.register(server -> {
31+
ticks++;
32+
33+
if (ticks == 50) {
34+
MixinEnvironment.getCurrentEnvironment().audit();
35+
server.halt(false);
36+
}
37+
});
38+
}
39+
}
40+
}
Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
1-
///*
2-
// * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
3-
// *
4-
// * Licensed under the Apache License, Version 2.0 (the "License");
5-
// * you may not use this file except in compliance with the License.
6-
// * You may obtain a copy of the License at
7-
// *
8-
// * http://www.apache.org/licenses/LICENSE-2.0
9-
// *
10-
// * Unless required by applicable law or agreed to in writing, software
11-
// * distributed under the License is distributed on an "AS IS" BASIS,
12-
// * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
// * See the License for the specific language governing permissions and
14-
// * limitations under the License.
15-
// */
16-
//
17-
//package net.fabricmc.fabric.test.base;
18-
//
19-
//import org.spongepowered.asm.mixin.MixinEnvironment;
20-
//
21-
//import net.minecraft.gametest.framework.GameTestHelper;
22-
//
1+
/*
2+
* Copyright (c) 2016, 2017, 2018, 2019 FabricMC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package net.fabricmc.fabric.test.base;
18+
19+
import org.spongepowered.asm.mixin.MixinEnvironment;
20+
21+
import net.minecraft.gametest.framework.GameTestHelper;
22+
2323
//import net.fabricmc.fabric.api.gametest.v1.GameTest;
24-
//
25-
//public class FabricApiBaseGameTest {
26-
// @GameTest
27-
// public void auditMixins(GameTestHelper helper) {
28-
// MixinEnvironment.getCurrentEnvironment().audit();
29-
//
30-
// helper.succeed();
31-
// }
32-
//}
24+
25+
public class FabricApiBaseGameTest {
26+
// @GameTest TODO
27+
public void auditMixins(GameTestHelper helper) {
28+
MixinEnvironment.getCurrentEnvironment().audit();
29+
30+
helper.succeed();
31+
}
32+
}
Lines changed: 28 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,27 @@
1-
///*
2-
// * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
3-
// *
4-
// * Licensed under the Apache License, Version 2.0 (the "License");
5-
// * you may not use this file except in compliance with the License.
6-
// * You may obtain a copy of the License at
7-
// *
8-
// * http://www.apache.org/licenses/LICENSE-2.0
9-
// *
10-
// * Unless required by applicable law or agreed to in writing, software
11-
// * distributed under the License is distributed on an "AS IS" BASIS,
12-
// * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
// * See the License for the specific language governing permissions and
14-
// * limitations under the License.
15-
// */
16-
//
17-
//package net.fabricmc.fabric.test.base;
18-
//
19-
//import static net.minecraft.commands.Commands.literal;
20-
//
21-
//import org.spongepowered.asm.mixin.MixinEnvironment;
22-
//
23-
//import net.minecraft.network.chat.Component;
24-
//
25-
//import net.fabricmc.api.ModInitializer;
26-
//import net.fabricmc.fabric.api.command.v2.CommandRegistrationCallback;
27-
//
28-
//public class FabricApiBaseTestInit implements ModInitializer {
29-
// @Override
30-
// public void onInitialize() {
31-
// // Command to call audit the mixin environment
1+
/*
2+
* Copyright (c) 2016, 2017, 2018, 2019 FabricMC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package net.fabricmc.fabric.test.base;
18+
19+
import net.fabricmc.api.ModInitializer;
20+
21+
public class FabricApiBaseTestInit implements ModInitializer {
22+
@Override
23+
public void onInitialize() {
24+
// Command to call audit the mixin environment
3225
// CommandRegistrationCallback.EVENT.register((dispatcher, buildContext, environment) -> {
3326
// dispatcher.register(literal("audit_mixins").executes(context -> {
3427
// context.getSource().sendSuccess(() -> Component.literal("Auditing mixin environment"), false);
@@ -45,7 +38,7 @@
4538
// return 1;
4639
// }));
4740
// });
48-
//
49-
// EventTests.run();
50-
// }
51-
//}
41+
42+
EventTests.run();
43+
}
44+
}

ffapi.gradle.properties

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
implementationVersion=3.0.0
22

3-
versionMc=26.1
4-
versionNeoForge=26.1.0.5-beta
5-
versionForgifiedFabricLoader=2.5.68+0.18.4+26.1
3+
versionMc=26.1.2
4+
versionNeoForge=26.1.2.73
5+
versionForgifiedFabricLoader=2.5.72+0.18.4+26.1
66

77
curseForgeId=889079
88
modrinthId=Aqlf1Shp

0 commit comments

Comments
 (0)