summaryrefslogtreecommitdiffstats
path: root/Tests/Server/server-test.py
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/Server/server-test.py')
-rw-r--r--Tests/Server/server-test.py26
1 files changed, 8 insertions, 18 deletions
diff --git a/Tests/Server/server-test.py b/Tests/Server/server-test.py
index 9380910..f3c3fc2 100644
--- a/Tests/Server/server-test.py
+++ b/Tests/Server/server-test.py
@@ -9,7 +9,7 @@ sourceDir = sys.argv[3]
buildDir = sys.argv[4] + "/" + os.path.splitext(os.path.basename(testFile))[0]
cmakeGenerator = sys.argv[5]
-print("Test:", testFile,
+print("Server Test:", testFile,
"\n-- SourceDir:", sourceDir,
"\n-- BuildDir:", buildDir,
"\n-- Generator:", cmakeGenerator)
@@ -17,24 +17,16 @@ print("Test:", testFile,
if os.path.exists(buildDir):
shutil.rmtree(buildDir)
-proc = cmakelib.initProc(cmakeCommand)
+cmakelib.filterBase = sourceDir
+
+proc = cmakelib.initServerProc(cmakeCommand)
with open(testFile) as f:
testData = json.loads(f.read())
for obj in testData:
- if 'sendRaw' in obj:
- data = obj['sendRaw']
- if debug: print("Sending raw:", data)
- cmakelib.writeRawData(proc, data)
- elif 'send' in obj:
- data = obj['send']
- if debug: print("Sending:", json.dumps(data))
- cmakelib.writePayload(proc, data)
- elif 'recv' in obj:
- data = obj['recv']
- if debug: print("Waiting for:", json.dumps(data))
- cmakelib.waitForMessage(proc, data)
+ if cmakelib.handleBasicMessage(proc, obj, debug):
+ pass
elif 'reply' in obj:
data = obj['reply']
if debug: print("Waiting for reply:", json.dumps(data))
@@ -103,13 +95,11 @@ for obj in testData:
print("MESSAGE:", obj["message"])
elif 'reconnect' in obj:
cmakelib.exitProc(proc)
- proc = cmakelib.initProc(cmakeCommand)
+ proc = cmakelib.initServerProc(cmakeCommand)
else:
print("Unknown command:", json.dumps(obj))
sys.exit(2)
print("Completed")
-cmakelib.exitProc(proc)
-print('cmake-server exited: %d' % proc.returncode)
-sys.exit(proc.returncode)
+cmakelib.shutdownProc(proc)