summaryrefslogtreecommitdiffstats
path: root/test/SCCS/explicit.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/SCCS/explicit.py')
-rw-r--r--test/SCCS/explicit.py46
1 files changed, 27 insertions, 19 deletions
diff --git a/test/SCCS/explicit.py b/test/SCCS/explicit.py
index a501dda..23bb6eb 100644
--- a/test/SCCS/explicit.py
+++ b/test/SCCS/explicit.py
@@ -28,6 +28,8 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
Test explicit checkouts from local SCCS files.
"""
+import string
+
import TestSCons
test = TestSCons.TestSCons()
@@ -39,10 +41,10 @@ if not sccs:
-test.subdir('sub')
+test.subdir('SCCS', 'sub', ['sub', 'SCCS'])
for f in ['aaa.in', 'bbb.in', 'ccc.in']:
- test.write(f, "%s\n" % f)
+ test.write(f, "%%F%% %s\n" % f)
args = "create %s" % f
test.run(program = sccs, arguments = args, stderr = None)
test.unlink(f)
@@ -61,7 +63,7 @@ test.unlink(['sub', 'SConscript'])
test.unlink(['sub', ',SConscript'])
for f in ['ddd.in', 'eee.in', 'fff.in']:
- test.write(['sub', f], "sub/%s\n" % f)
+ test.write(['sub', f], "%%F%% sub/%s\n" % f)
args = "create %s" % f
test.run(chdir = 'sub', program = sccs, arguments = args, stderr = None)
test.unlink(['sub', f])
@@ -76,6 +78,7 @@ def cat(env, source, target):
f.write(open(src, "rb").read())
f.close()
env = Environment(BUILDERS={'Cat':Builder(action=cat)},
+ SCCSCOM = 'cd ${TARGET.dir} && $SCCS get $SCCSGETFLAGS ${TARGET.file}',
SCCSGETFLAGS='-e')
env.Cat('aaa.out', 'aaa.in')
env.Cat('bbb.out', 'bbb.in')
@@ -89,34 +92,39 @@ test.write('bbb.in', "checked-out bbb.in\n")
test.write(['sub', 'eee.in'], "checked-out sub/eee.in\n")
-test.run(arguments = '.',
- stdout = test.wrap_stdout(read_str = """\
-sccs get -e sub/SConscript
-""",
- build_str = """\
+test.run(arguments = '.', stderr = None)
+
+lines = string.split("""
+sccs get -e SConscript
sccs get -e aaa.in
cat(["aaa.out"], ["aaa.in"])
cat(["bbb.out"], ["bbb.in"])
sccs get -e ccc.in
cat(["ccc.out"], ["ccc.in"])
cat(["all"], ["aaa.out", "bbb.out", "ccc.out"])
-sccs get -e sub/ddd.in
+sccs get -e ddd.in
cat(["sub/ddd.out"], ["sub/ddd.in"])
cat(["sub/eee.out"], ["sub/eee.in"])
-sccs get -e sub/fff.in
+sccs get -e fff.in
cat(["sub/fff.out"], ["sub/fff.in"])
cat(["sub/all"], ["sub/ddd.out", "sub/eee.out", "sub/fff.out"])
-"""),
- stderr = """\
-sub/SConscript 1.1 -> 1.2: 5 lines
-aaa.in 1.1 -> 1.2: 1 lines
-ccc.in 1.1 -> 1.2: 1 lines
-sub/ddd.in 1.1 -> 1.2: 1 lines
-sub/fff.in 1.1 -> 1.2: 1 lines
+""", '\n')
+
+stdout = test.stdout()
+missing = filter(lambda l, s=stdout: string.find(s, l) == -1, lines)
+if missing:
+ print "Missing the following output lines:"
+ print string.join(missing, '\n')
+ print "Actual STDOUT =========="
+ print stdout
+ test.fail_test(1)
+
+test.must_match('all', """\
+%F% aaa.in
+checked-out bbb.in
+%F% ccc.in
""")
-test.must_match('all', "aaa.in\nchecked-out bbb.in\nccc.in\n")
-
test.must_be_writable(test.workpath('sub', 'SConscript'))
test.must_be_writable(test.workpath('aaa.in'))
test.must_be_writable(test.workpath('ccc.in'))