From a03eb9e1c951be88f37c47cb603c880154d3e481 Mon Sep 17 00:00:00 2001 From: garyo Date: Thu, 11 Dec 2008 03:12:25 +0000 Subject: [PATCH] Added regression test for issue #1249 git-svn-id: http://scons.tigris.org/svn/scons/trunk@3824 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- src/engine/SCons/Defaults.py | 2 +- test/Mkdir.py | 38 +++++++++++++++++++++++++++++++++++- 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/src/engine/SCons/Defaults.py b/src/engine/SCons/Defaults.py index 5d78215d..4a1bcde8 100644 --- a/src/engine/SCons/Defaults.py +++ b/src/engine/SCons/Defaults.py @@ -226,7 +226,7 @@ def mkdir_func(dest): except os.error, e: p = str(entry) if e[0] == errno.EEXIST and os.path.isdir(str(entry)): - pass + pass # not an error if already exists else: raise diff --git a/test/Mkdir.py b/test/Mkdir.py index e6aeadca..144c9a6c 100644 --- a/test/Mkdir.py +++ b/test/Mkdir.py @@ -34,7 +34,7 @@ import TestSCons test = TestSCons.TestSCons() -test.subdir('work1', 'work2') +test.subdir('work1', 'work2', 'work3') test.write(['work1', 'SConstruct'], """ Execute(Mkdir('d1')) @@ -152,4 +152,40 @@ test.run(chdir = 'work2', arguments = 'hello/file2.out output') test.must_match(['work2', 'output'], "work2/file1.in\nwork2/file2.in\n") + +#---------------------------------------- +# Regression test for bug #1249 + +test.subdir(['work3', 'sub1'], ['work3', 'sub1', 'sub11']) + +test.write(['work3', 'SConstruct'], """\ +#/SConstruct ------------------------------------------ +import os +env = Environment(ENV = os.environ) +BuildDir('build', 'sub1', duplicate=0) +base = '#build/sub1' +Export('env base') +SConscript('sub1/SConscript', exports='env') +""") + +test.write(['work3', 'sub1', 'SConscript'], """\ +#/sub1/SConscript ---------------------------------- +Import ('env base') +test1 = base + '/test1' +Export ('env test1') +env.Command(Dir(test1), '', Mkdir('$TARGET')) +SConscript('sub11/SConscript') +""") + +test.write(['work3', 'sub1', 'sub11', 'SConscript'], """\ +#/sub1/sub11/SConscript------------------------- +Import('env test1') +test11 = test1 + '/test11' +print 'test11 = ' + test11 +env.Command(Dir(test11), '', Mkdir('$TARGET')) +""") + +test.run(chdir = 'work3', arguments = '') + test.pass_test() + -- 2.26.2