Files
tgstation-server/tests/DMAPI/BasicOperation/Test.dm
Dominion 49c6f37693 Add test helpers to test .dmes
- Make long_running_test_copy.dme just include the original
2023-05-22 19:11:06 -04:00

50 lines
1.2 KiB
Plaintext

/world/proc/RunTest()
text2file("SUCCESS", "test_success.txt")
log << "About to call TgsNew()"
sleep_offline = FALSE
TgsNew(minimum_required_security_level = TGS_SECURITY_SAFE)
log << "About to call StartAsync()"
StartAsync()
/proc/StartAsync()
set waitfor = FALSE
Run()
/proc/Run()
world.log << "sleep"
sleep(50)
world.TgsTargetedChatBroadcast("Sample admin-only message", TRUE)
var/list/world_params = world.params
if(!("test" in world_params) || world_params["test"] != "bababooey")
FailTest("Expected parameter test=bababooey but did not receive", "test_fail_reason.txt")
world.log << "sleep2"
sleep(150)
world.log << "Terminating..."
world.TgsEndProcess()
world.log << "You really shouldn't be able to read this"
/world/Export(url)
log << "Export: [url]"
return ..()
/world/Topic(T, Addr, Master, Keys)
world.log << "Topic: [T]"
. = HandleTopic(T)
world.log << "Response: [.]"
/world/proc/HandleTopic(T)
TGS_TOPIC
/world/Reboot(reason)
TgsReboot()
/datum/tgs_chat_command/echo
name = "echo"
help_text = "echos input parameters"
/datum/tgs_chat_command/echo/Run(datum/tgs_chat_user/sender, params)
return "[sender.channel.connection_name]|[sender.channel.friendly_name]|[sender.friendly_name]: [params]"