mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 02:16:05 +00:00
31 lines
797 B
Python
Executable File
31 lines
797 B
Python
Executable File
#!/usr/bin/env python3
|
|
import os
|
|
import distutils.spawn
|
|
import asyncio
|
|
|
|
import travis_utils
|
|
|
|
def main():
|
|
if os.environ.get("DM_UNIT_TESTS") != "1":
|
|
print("DM_UNIT_TESTS is not set, not running tests.")
|
|
return
|
|
|
|
dmb = os.environ.get("PROJECT_NAME") # The DMB file to run.
|
|
if not dmb:
|
|
print("No project name specified.")
|
|
exit(1)
|
|
dmb += ".dmb"
|
|
|
|
executable = "DreamDaemon"
|
|
dreamdaemon = distutils.spawn.find_executable(executable)
|
|
if not dreamdaemon:
|
|
print("Unable to find {}.".format(executable))
|
|
exit(1)
|
|
|
|
loop = travis_utils.get_platform_event_loop()
|
|
code = loop.run_until_complete(travis_utils.run_with_timeout_guards([dreamdaemon, dmb, "-close", "-trusted"]))
|
|
exit(code)
|
|
|
|
if __name__ == "__main__":
|
|
main()
|