diff options
Diffstat (limited to 'cpp/test/IceUtil/condvar/run.py')
-rwxr-xr-x | cpp/test/IceUtil/condvar/run.py | 57 |
1 files changed, 16 insertions, 41 deletions
diff --git a/cpp/test/IceUtil/condvar/run.py b/cpp/test/IceUtil/condvar/run.py index ad44a80d148..8940c1613ad 100755 --- a/cpp/test/IceUtil/condvar/run.py +++ b/cpp/test/IceUtil/condvar/run.py @@ -10,56 +10,31 @@ import os, sys -for toplevel in [".", "..", "../..", "../../..", "../../../..", "../../../../.."]: - toplevel = os.path.normpath(toplevel) - if os.path.exists(os.path.join(toplevel, "config", "TestUtil.py")): - break -else: +path = [ ".", "..", "../..", "../../..", "../../../.." ] +head = os.path.dirname(sys.argv[0]) +if len(head) > 0: + path = [os.path.join(head, p) for p in path] +path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] +if len(path) == 0: raise "can't find toplevel directory!" +sys.path.append(os.path.join(path[0])) +from scripts import * -sys.path.append(os.path.join(toplevel, "config")) -import TestUtil -TestUtil.processCmdLine() - -testdir = os.path.dirname(os.path.abspath(__file__)) - -workqueue = os.path.join(testdir, "workqueue") +workqueue = os.path.join(os.getcwd(), "workqueue") print "starting workqueue...", -if TestUtil.debug: - print "(" + workqueue + ")", -workqueuePipe = os.popen(workqueue + " 2>&1") +client = TestUtil.spawnClient(workqueue) print "ok" +client.waitTestSuccess() -TestUtil.printOutputFromPipe(workqueuePipe) - -workqueueStatus = TestUtil.closePipe(workqueuePipe) - -if workqueueStatus: - sys.exit(1) - -match = os.path.join(testdir, "match") +match = os.path.join(os.getcwd(), "match") print "starting signal match...", -matchPipe = os.popen(match + " 2>&1") +client = TestUtil.spawnClient(match) print "ok" - -TestUtil.printOutputFromPipe(matchPipe) - -matchStatus = TestUtil.closePipe(matchPipe) - -if matchStatus: - sys.exit(1) +client.waitTestSuccess() print "starting broadcast match...", -matchPipe = os.popen(match + " -b" + " 2>&1") +client = TestUtil.spawnClient(match + " -b") print "ok" - -TestUtil.printOutputFromPipe(matchPipe) - -matchStatus = TestUtil.closePipe(matchPipe) - -if matchStatus: - sys.exit(1) - -sys.exit(0) +client.waitTestSuccess() |