summaryrefslogtreecommitdiffstats
path: root/test/Chmod.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/Chmod.py')
-rw-r--r--test/Chmod.py35
1 files changed, 35 insertions, 0 deletions
diff --git a/test/Chmod.py b/test/Chmod.py
index 92fa639..61d21eb 100644
--- a/test/Chmod.py
+++ b/test/Chmod.py
@@ -61,6 +61,11 @@ env.Command('f6.out', 'f6.in', [Chmod('$FILE', 0666), Cat])
env.Command('f7.out', 'f7.in', [Cat,
Chmod('Chmod-$SOURCE', 0666),
Chmod('${TARGET}-Chmod', 0666)])
+
+# Make sure Chmod works with a list of arguments
+env = Environment(FILE = 'f9')
+env.Command('f8.out', 'f8.in', [Chmod(['$FILE', File('f10')], 0666), Cat])
+Execute(Chmod(['d11', Dir('d12')], 0777))
""")
test.write('f1', "f1\n")
@@ -78,6 +83,11 @@ test.write('f6.in', "f6.in\n")
test.write('f7.in', "f7.in\n")
test.write('Chmod-f7.in', "Chmod-f7.in\n")
test.write('f7.out-Chmod', "f7.out-Chmod\n")
+test.write('f8.in', "f8.in\n")
+test.write('f9', "f9\n")
+test.write('f10', "f10\n")
+test.subdir('d11')
+test.subdir('d12')
os.chmod(test.workpath('f1'), 0444)
os.chmod(test.workpath('f1-File'), 0444)
@@ -88,12 +98,17 @@ os.chmod(test.workpath('d4'), 0555)
os.chmod(test.workpath('f5'), 0444)
os.chmod(test.workpath('Chmod-f7.in'), 0444)
os.chmod(test.workpath('f7.out-Chmod'), 0444)
+os.chmod(test.workpath('f9'), 0444)
+os.chmod(test.workpath('f10'), 0444)
+os.chmod(test.workpath('d11'), 0555)
+os.chmod(test.workpath('d12'), 0555)
expect = test.wrap_stdout(read_str = """\
Chmod("f1", 0666)
Chmod("f1-File", 0666)
Chmod("d2", 0777)
Chmod("d2-Dir", 0777)
+Chmod(["d11", "d12"], 0777)
""",
build_str = """\
cat(["bar.out"], ["bar.in"])
@@ -104,6 +119,8 @@ cat(["f6.out"], ["f6.in"])
cat(["f7.out"], ["f7.in"])
Chmod("Chmod-f7.in", 0666)
Chmod("f7.out-Chmod", 0666)
+Chmod(["f9", "f10"], 0666)
+cat(["f8.out"], ["f8.in"])
""")
test.run(options = '-n', arguments = '.', stdout = expect)
@@ -128,6 +145,15 @@ s = stat.S_IMODE(os.stat(test.workpath('Chmod-f7.in'))[stat.ST_MODE])
test.fail_test(s != 0444)
s = stat.S_IMODE(os.stat(test.workpath('f7.out-Chmod'))[stat.ST_MODE])
test.fail_test(s != 0444)
+test.must_not_exist('f8.out')
+s = stat.S_IMODE(os.stat(test.workpath('f9'))[stat.ST_MODE])
+test.fail_test(s != 0444)
+s = stat.S_IMODE(os.stat(test.workpath('f10'))[stat.ST_MODE])
+test.fail_test(s != 0444)
+s = stat.S_IMODE(os.stat(test.workpath('d11'))[stat.ST_MODE])
+test.fail_test(s != 0555)
+s = stat.S_IMODE(os.stat(test.workpath('d12'))[stat.ST_MODE])
+test.fail_test(s != 0555)
test.run()
@@ -152,5 +178,14 @@ s = stat.S_IMODE(os.stat(test.workpath('Chmod-f7.in'))[stat.ST_MODE])
test.fail_test(s != 0666)
s = stat.S_IMODE(os.stat(test.workpath('f7.out-Chmod'))[stat.ST_MODE])
test.fail_test(s != 0666)
+test.must_match('f8.out', "f8.in\n")
+s = stat.S_IMODE(os.stat(test.workpath('f9'))[stat.ST_MODE])
+test.fail_test(s != 0666)
+s = stat.S_IMODE(os.stat(test.workpath('f10'))[stat.ST_MODE])
+test.fail_test(s != 0666)
+s = stat.S_IMODE(os.stat(test.workpath('d11'))[stat.ST_MODE])
+test.fail_test(s != 0777)
+s = stat.S_IMODE(os.stat(test.workpath('d12'))[stat.ST_MODE])
+test.fail_test(s != 0777)
test.pass_test()