Add DMAPI triggerable custom events

Closes #1746
This commit is contained in:
Jordan Dominion
2024-02-19 16:56:01 -05:00
parent c17ecb8426
commit 0bbf7cd46a
31 changed files with 420 additions and 78 deletions
+15
View File
@@ -19,6 +19,21 @@
if(!("test" in world_params) || world_params["test"] != "bababooey")
FailTest("Expected parameter test=bababooey but did not receive", "test_fail_reason.txt")
fdel("test_event_output.txt")
var/test_data = "nwfiuurhfu"
world.TgsTriggerEvent("test_event", list(test_data), TRUE)
if(!fexists("test_event_output.txt"))
FailTest("Expected test_event_output.txt to exist here", "test_fail_reason.txt")
var/test_contents = copytext(file2text("test_event_output.txt"), 1, length(test_data) + 1)
if(test_contents != test_data)
FailTest("Expected test_event_output.txt to contain [test_data] here. Got [test_contents]", "test_fail_reason.txt")
fdel("test_event_output.txt")
world.TgsTriggerEvent("test_event", list("asdf"), FALSE)
if(fexists("test_event_output.txt"))
FailTest("Expected test_event_output.txt to not exist here", "test_fail_reason.txt")
world.log << "sleep2"
sleep(150)
world.log << "Terminating..."
@@ -0,0 +1,7 @@
echo "Running test_event script"
rem mingw has their own /usr/bin/timeout
C:\Windows\system32\timeout.exe /t 5
cd %1
cd tests\DMAPI\BasicOperation
echo %2 > test_event_output.txt
+13
View File
@@ -0,0 +1,13 @@
#!/bin/bash
set -e
echo "Running test_event script - $1 - $2"
sleep 5
cd $1
cd tests/DMAPI/BasicOperation
echo $2 > test_event_output.txt