diff options
Diffstat (limited to 'test/Perforce')
-rw-r--r-- | test/Perforce/P4COM.py | 14 | ||||
-rw-r--r-- | test/Perforce/P4COMSTR.py | 4 | ||||
-rw-r--r-- | test/Perforce/Perforce.py | 17 |
3 files changed, 18 insertions, 17 deletions
diff --git a/test/Perforce/P4COM.py b/test/Perforce/P4COM.py index c33254a..11b28e3 100644 --- a/test/Perforce/P4COM.py +++ b/test/Perforce/P4COM.py @@ -32,7 +32,7 @@ import os.path import TestSCons -python = TestSCons.python +_python_ = TestSCons._python_ test = TestSCons.TestSCons() @@ -65,7 +65,7 @@ def cat(env, source, target): f.close() env = Environment(TOOLS = ['default', 'Perforce'], BUILDERS={'Cat':Builder(action=cat)}, - P4COM='%(python)s my-p4.py $TARGET') + P4COM='%(_python_)s my-p4.py $TARGET') env.Cat('aaa.out', 'aaa.in') env.Cat('bbb.out', 'bbb.in') env.Cat('ccc.out', 'ccc.in') @@ -92,19 +92,19 @@ test.write(['Perforce', 'sub', 'fff.in'], "Perforce/sub/fff.in\n") test.run(arguments = '.', stdout = test.wrap_stdout(read_str = """\ -%(python)s my-p4.py %(sub_SConscript)s +%(_python_)s my-p4.py %(sub_SConscript)s """ % locals(), build_str = """\ -%(python)s my-p4.py aaa.in +%(_python_)s my-p4.py aaa.in cat(["aaa.out"], ["aaa.in"]) cat(["bbb.out"], ["bbb.in"]) -%(python)s my-p4.py ccc.in +%(_python_)s my-p4.py ccc.in cat(["ccc.out"], ["ccc.in"]) cat(["all"], ["aaa.out", "bbb.out", "ccc.out"]) -%(python)s my-p4.py %(sub_ddd_in)s +%(_python_)s my-p4.py %(sub_ddd_in)s cat(["%(sub_ddd_out)s"], ["%(sub_ddd_in)s"]) cat(["%(sub_eee_out)s"], ["%(sub_eee_in)s"]) -%(python)s my-p4.py %(sub_fff_in)s +%(_python_)s my-p4.py %(sub_fff_in)s cat(["%(sub_fff_out)s"], ["%(sub_fff_in)s"]) cat(["%(sub_all)s"], ["%(sub_ddd_out)s", "%(sub_eee_out)s", "%(sub_fff_out)s"]) """ % locals())) diff --git a/test/Perforce/P4COMSTR.py b/test/Perforce/P4COMSTR.py index d9a3bc0..72f05b8 100644 --- a/test/Perforce/P4COMSTR.py +++ b/test/Perforce/P4COMSTR.py @@ -32,7 +32,7 @@ import os.path import TestSCons -python = TestSCons.python +_python_ = TestSCons._python_ test = TestSCons.TestSCons() @@ -65,7 +65,7 @@ def cat(env, source, target): f.close() env = Environment(TOOLS = ['default', 'Perforce'], BUILDERS={'Cat':Builder(action=cat)}, - P4COM='%(python)s my-p4.py $TARGET', + P4COM='%(_python_)s my-p4.py $TARGET', P4COMSTR='Checking out $TARGET from our fake Perforce') env.Cat('aaa.out', 'aaa.in') env.Cat('bbb.out', 'bbb.in') diff --git a/test/Perforce/Perforce.py b/test/Perforce/Perforce.py index f813f10..0133ced 100644 --- a/test/Perforce/Perforce.py +++ b/test/Perforce/Perforce.py @@ -32,7 +32,6 @@ on port 1666, as well as that of course a client must be present. """ import os -import socket import string import TestSCons @@ -41,11 +40,13 @@ class TestPerforce(TestSCons.TestSCons): def __init__(self, *args, **kw): apply(TestSCons.TestSCons.__init__, (self,)+args, kw) - self._p4prog = self.where_is('p4') - if not self._p4prog: + self.p4path = self.where_is('p4') + if not self.p4path: self.skip_test("Could not find 'p4'; skipping test(s).\n") - self.host = socket.gethostname() + #import socket + #self.host = socket.gethostname() + self.host = '127.0.0.1' self.user = os.environ.get('USER') if not self.user: @@ -98,7 +99,7 @@ class TestPerforce(TestSCons.TestSCons): arguments = args[0] args = args[1:] kw['arguments'] = string.join(self.p4portflags + [arguments]) - kw['program'] = self._p4prog + kw['program'] = self.p4path return apply(self.run, args, kw) def substitute(self, s, **kw): @@ -145,8 +146,6 @@ Client: %(client)s Owner: %(user)s -Host: %(host)s - Description: Created by %(user)s. @@ -234,7 +233,9 @@ def cat(env, source, target): for src in source: f.write(open(src, "rb").read()) f.close() -env = Environment(BUILDERS={'Cat':Builder(action=cat)}, +env = Environment(tools = ['default', 'Perforce'], + BUILDERS={'Cat':Builder(action=cat)}, + P4=r'%(p4path)s', P4FLAGS='%(portflag)s -c testclient2') env.Cat('aaa.out', 'foo/aaa.in') env.Cat('bbb.out', 'foo/bbb.in') |