diff options
Diffstat (limited to 'cpp/test/Freeze/dbmap/run.py')
-rwxr-xr-x | cpp/test/Freeze/dbmap/run.py | 38 |
1 files changed, 12 insertions, 26 deletions
diff --git a/cpp/test/Freeze/dbmap/run.py b/cpp/test/Freeze/dbmap/run.py index 294171da26c..bdce0c97426 100755 --- a/cpp/test/Freeze/dbmap/run.py +++ b/cpp/test/Freeze/dbmap/run.py @@ -10,34 +10,20 @@ 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__)) - -dbdir = os.path.join(testdir, "db") +dbdir = os.path.join(os.getcwd(), "db") TestUtil.cleanDbDir(dbdir) -client = os.path.join(testdir, "client") - -print "starting client...", -clientPipe = os.popen(TestUtil.getCommandLine(client, TestUtil.DriverConfig("client")) + " --Freeze.Warn.Rollback=0 " + - testdir + " 2>&1") -print "ok" - -TestUtil.printOutputFromPipe(clientPipe) - -clientStatus = TestUtil.closePipe(clientPipe) - -if clientStatus: - sys.exit(1) +client = os.path.join(os.getcwd(), "client") -sys.exit(0) +clientProc = TestUtil.startClient(client, " --Freeze.Warn.Rollback=0 %s" % os.getcwd()) +clientProc.waitTestSuccess() |