-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.py
33 lines (25 loc) · 933 Bytes
/
run.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import os, time
from lib.EventBus import EventBus
from lib.TestRunner import TestRunner
from lib.WebsocketServer import WebSocketServer
baseDir = './tests/'
def getTests():
testToRun = None
for filename in os.listdir(baseDir):
if filename != "__util":
subPath = os.path.join(baseDir, filename)
if os.path.isdir(subPath):
runPath = os.path.join(subPath, 'run_test.py')
if os.path.exists(runPath):
testToRun = runPath
print("Test called", filename, "found!")
else:
print("ERR: Test called", filename, "found without run_test.py!")
return testToRun
if __name__ == "__main__":
test = getTests()
eventBus = EventBus()
myRunner = TestRunner(eventBus)
server = WebSocketServer(eventBus, 9000)
myRunner.startTest(test)
server.start() # <-- this is blocking