summaryrefslogtreecommitdiffstats
path: root/test/CacheDir.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/CacheDir.py')
-rw-r--r--test/CacheDir.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/CacheDir.py b/test/CacheDir.py
index a906b6a..44dd708 100644
--- a/test/CacheDir.py
+++ b/test/CacheDir.py
@@ -270,5 +270,33 @@ test.run(chdir = 'subdir')
test.fail_test(os.path.exists(test.workpath('cache3', 'N', 'None')))
+#############################################################################
+# Test that multiple target files get retrieved from cache correctly.
+
+test.subdir('multiple', 'cache4')
+
+test.write(['multiple', 'SConstruct'], """\
+CacheDir(r'%s')
+env = Environment()
+env.Command(['foo', 'bar'], ['input'], 'touch foo bar')
+""" % (test.workpath('cache4')))
+
+test.write(['multiple', 'input'], "multiple/input\n")
+
+test.run(chdir = 'multiple')
+
+test.fail_test(not os.path.exists(test.workpath('multiple', 'foo')))
+test.fail_test(not os.path.exists(test.workpath('multiple', 'bar')))
+
+test.run(chdir = 'multiple', arguments = '-c')
+
+test.fail_test(os.path.exists(test.workpath('multiple', 'foo')))
+test.fail_test(os.path.exists(test.workpath('multiple', 'bar')))
+
+test.run(chdir = 'multiple')
+
+test.fail_test(not os.path.exists(test.workpath('multiple', 'foo')))
+test.fail_test(not os.path.exists(test.workpath('multiple', 'bar')))
+
# All done.
test.pass_test()