summaryrefslogtreecommitdiff
path: root/test/option-n.py
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2004-09-15 22:00:59 +0000
committerSteven Knight <knight@baldmt.com>2004-09-15 22:00:59 +0000
commit812c39883da45f94b3c0e427af8504f1aab76a7f (patch)
tree32fd66fe73247bce17c12892145b19a1d90d68ab /test/option-n.py
parent1d3e09e02b05669f1f26bec1c7781f9de60cfc28 (diff)
downloadscons-812c39883da45f94b3c0e427af8504f1aab76a7f.tar.gz
Better -n test: make sure the directory is clean first. (Kevin Quick)
Diffstat (limited to 'test/option-n.py')
-rw-r--r--test/option-n.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/test/option-n.py b/test/option-n.py
index fab117b0..8730c835 100644
--- a/test/option-n.py
+++ b/test/option-n.py
@@ -33,7 +33,7 @@ This test verifies:
4) that source files don't get duplicated in a BuildDir
when -n is used.
5) that Configure calls don't build any files. If a file
- needs to be build (i.e. is not up-to-date), a ConfigureError
+ needs to be built (i.e. is not up-to-date), a ConfigureError
is raised.
"""
@@ -158,6 +158,20 @@ test.fail_test(not os.path.exists(test.workpath('install', 'f3.in')))
# Make sure duplicate source files in a BuildDir aren't created
# when the -n option is used.
+
+# First, make sure none of the previous non-dryrun invocations caused
+# the build directory to be populated. Processing of the
+# src/SConscript (actually build/SConscript) will reference f4.in as a
+# source, causing a Node object to be built for "build/f4.in".
+# Creating the node won't cause "build/f4.in" to be created from
+# "src/f4.in", but that *is* a side-effect of calling the exists()
+# method on that node, which may happen via other processing.
+# Therefore add this conditional removal to ensure a clean setting
+# before running this test.
+
+if os.path.exists(test.workpath('build', 'f4.in')):
+ test.unlink(test.workpath('build', 'f4.in'))
+
test.run(arguments = '-n build')
test.fail_test(os.path.exists(test.workpath('build', 'f4.in')))