summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2004-09-15 22:00:59 (GMT)
committerSteven Knight <knight@baldmt.com>2004-09-15 22:00:59 (GMT)
commitf4ebab8479e70f7af040e5d918d1d2429770d2ae (patch)
tree32fd66fe73247bce17c12892145b19a1d90d68ab
parent2b80fed24beeb290b4683c69510dea9add0c2fd2 (diff)
downloadSCons-f4ebab8479e70f7af040e5d918d1d2429770d2ae.zip
SCons-f4ebab8479e70f7af040e5d918d1d2429770d2ae.tar.gz
SCons-f4ebab8479e70f7af040e5d918d1d2429770d2ae.tar.bz2
Better -n test: make sure the directory is clean first. (Kevin Quick)
-rw-r--r--src/CHANGES.txt2
-rw-r--r--test/option-n.py16
2 files changed, 17 insertions, 1 deletions
diff --git a/src/CHANGES.txt b/src/CHANGES.txt
index bb18b31..ffd0abb 100644
--- a/src/CHANGES.txt
+++ b/src/CHANGES.txt
@@ -78,6 +78,8 @@ RELEASE 0.97 - XXX
- Allow optional names to be attached to Builders, for default
Builders that don't get attached to construction environments.
+ - Test enhancements in SourceCode.py and option-n.py.
+
From Christoph Wiedemann:
- Add an Environment.SetDefault() method that only sets values if
diff --git a/test/option-n.py b/test/option-n.py
index fab117b..8730c83 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')))