From bc14b0f7a271c692540e8ceee03b533a5b13233f Mon Sep 17 00:00:00 2001 From: stevenknight Date: Wed, 15 Sep 2004 22:00:59 +0000 Subject: [PATCH] Better -n test: make sure the directory is clean first. (Kevin Quick) git-svn-id: http://scons.tigris.org/svn/scons/trunk@1075 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- src/CHANGES.txt | 2 ++ test/option-n.py | 16 +++++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/CHANGES.txt b/src/CHANGES.txt index bb18b312..ffd0abb8 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 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'))) -- 2.26.2