mirror of
https://gitlab.bixilon.de/bixilon/pixlyzer-physics.git
synced 2025-09-24 04:43:17 -04:00
save physics test result to file
This commit is contained in:
parent
c6b328675d
commit
bc097213c0
@ -1,5 +1,6 @@
|
||||
package de.bixilon.pixlyzer.physics
|
||||
|
||||
import de.bixilon.pixlyzer.PixLyzer
|
||||
import de.bixilon.pixlyzer.physics.tests.AbstractTest
|
||||
import de.bixilon.pixlyzer.physics.tests.EmptyTest
|
||||
import de.bixilon.pixlyzer.physics.tests.GravityTest
|
||||
@ -31,6 +32,7 @@ object PhysicsExtractor {
|
||||
|
||||
@JvmStatic
|
||||
fun start() {
|
||||
val data: MutableMap<String, Any> = mutableMapOf()
|
||||
for (tests in tests) {
|
||||
val instance = tests.getConstructor().newInstance()
|
||||
|
||||
@ -39,13 +41,17 @@ object PhysicsExtractor {
|
||||
if (!method.isAnnotationPresent(PhysicsTest::class.java)) {
|
||||
continue
|
||||
}
|
||||
val id = method.getAnnotation(PhysicsTest::class.java).id
|
||||
try {
|
||||
run(method, instance)
|
||||
data.put(id, instance.result)?.let { throw IllegalStateException("Duplicated test: $id") }
|
||||
} catch (error: Throwable) {
|
||||
error.printStackTrace()
|
||||
}
|
||||
}
|
||||
}
|
||||
PixLyzer.writData("${PixLyzer.outputDirectory.absolutePath}/physics/physics", data)
|
||||
|
||||
exitProcess(0)
|
||||
}
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ class GravityTest : AbstractTest() {
|
||||
storeBasic()
|
||||
}
|
||||
|
||||
@PhysicsTest("forwards_falling_2")
|
||||
@PhysicsTest("forwards_falling_3")
|
||||
fun forwardFalling3() {
|
||||
player.teleport(45.00, 178.0, 13.00)
|
||||
player.setKeys(forwards = true)
|
||||
@ -78,7 +78,7 @@ class GravityTest : AbstractTest() {
|
||||
storeBasic()
|
||||
}
|
||||
|
||||
@PhysicsTest("backwards_falling_2")
|
||||
@PhysicsTest("backwards_falling_3")
|
||||
fun backwardsFalling3() {
|
||||
player.teleport(45.00, 178.0, 13.00)
|
||||
player.setKeys(backwards = true)
|
||||
|
Loading…
x
Reference in New Issue
Block a user