ICE 3.4.2
[php5-ice-freebsdport.git] / cpp / test / Freeze / complex / run.py
blobdeae63146e19aac9fa153ecbfa2b8627bac3ffb4
1 #!/usr/bin/env python
2 # **********************************************************************
4 # Copyright (c) 2003-2011 ZeroC, Inc. All rights reserved.
6 # This copy of Ice is licensed to you under the terms described in the
7 # ICE_LICENSE file included in this distribution.
9 # **********************************************************************
11 import os, sys
13 path = [ ".", "..", "../..", "../../..", "../../../.." ]
14 head = os.path.dirname(sys.argv[0])
15 if len(head) > 0:
16 path = [os.path.join(head, p) for p in path]
17 path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ]
18 if len(path) == 0:
19 raise "can't find toplevel directory!"
20 sys.path.append(os.path.join(path[0]))
21 from scripts import *
23 testdir = os.path.dirname(os.path.abspath(__file__))
26 # Clean the contents of the database directory.
28 dbdir = os.path.join(os.getcwd(), "db")
29 TestUtil.cleanDbDir(dbdir)
31 client = os.path.join(os.getcwd(), "client")
33 if TestUtil.appverifier:
34 TestUtil.setAppVerifierSettings([client])
36 print "starting populate...",
37 populateProc = TestUtil.startClient(client, ' --dbdir "%s" populate' % os.getcwd(), startReader = False)
38 print "ok"
39 populateProc.startReader()
40 populateProc.waitTestSuccess()
42 print "starting verification client...",
43 clientProc = TestUtil.startClient(client, ' --dbdir "%s" validate' % os.getcwd(), startReader = False)
44 print "ok"
45 clientProc.startReader()
46 clientProc.waitTestSuccess()
48 if TestUtil.appverifier:
49 TestUtil.appVerifierAfterTestEnd([client])