summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2003-08-19 23:06:05 (GMT)
committerSteven Knight <knight@baldmt.com>2003-08-19 23:06:05 (GMT)
commitda45157ba79c6e988c0ac89555141d02d23c5f29 (patch)
tree22791a098172f2e7191e0c35debf11b5da26e0ed
parente167fa6ca236dbe95f2a09a63a333436d50b3370 (diff)
downloadSCons-da45157ba79c6e988c0ac89555141d02d23c5f29.zip
SCons-da45157ba79c6e988c0ac89555141d02d23c5f29.tar.gz
SCons-da45157ba79c6e988c0ac89555141d02d23c5f29.tar.bz2
Portability fixes for tests.
-rw-r--r--doc/man/scons.12
-rw-r--r--src/CHANGES.txt3
-rw-r--r--src/engine/SCons/Defaults.py4
-rw-r--r--test/BitKeeper.py4
-rw-r--r--test/ToolSurrogate.py10
5 files changed, 13 insertions, 10 deletions
diff --git a/doc/man/scons.1 b/doc/man/scons.1
index aaf6c0f..640dc67 100644
--- a/doc/man/scons.1
+++ b/doc/man/scons.1
@@ -4359,7 +4359,7 @@ will add to the (now empty) default-target list
like normal.
.TP
-.RI DefaultEnvironment()
+.RI DefaultEnvironment([ args ])
Creates and returns a default construction environment object.
This construction environment is used internally by SCons
in order to fetch source files transparently
diff --git a/src/CHANGES.txt b/src/CHANGES.txt
index a990f93..8b5e266 100644
--- a/src/CHANGES.txt
+++ b/src/CHANGES.txt
@@ -18,6 +18,9 @@ RELEASE X.XX - XXX, XX XXX XXXX XX:XX:XX XXXXX
- Refactor the DictCmdGenerator class to be a Selector subclass.
+ - Allow the DefaultEnvironment() function to take arguments and pass
+ them to instantiation of the default construction environment.
+
From Gerard Patel
- When the yacc -d flag is used, take the .h file base name from the
diff --git a/src/engine/SCons/Defaults.py b/src/engine/SCons/Defaults.py
index 5ade3e0..66e8b00 100644
--- a/src/engine/SCons/Defaults.py
+++ b/src/engine/SCons/Defaults.py
@@ -60,10 +60,10 @@ _default_env = None
# Lazily instantiate the default environment so the overhead of creating
# it doesn't apply when it's not needed.
-def DefaultEnvironment():
+def DefaultEnvironment(*args, **kw):
global _default_env
if not _default_env:
- _default_env = SCons.Environment.Environment()
+ _default_env = apply(SCons.Environment.Environment, args, kw)
return _default_env
diff --git a/test/BitKeeper.py b/test/BitKeeper.py
index 3374f92..4d703ab 100644
--- a/test/BitKeeper.py
+++ b/test/BitKeeper.py
@@ -46,7 +46,7 @@ def is_writable(file):
try:
login = os.getlogin()
-except AttributeError:
+except (AttributeError, OSError):
try:
login = os.environ['USER']
except KeyError:
@@ -298,7 +298,7 @@ def cat(env, source, target):
for src in source:
f.write(open(src, "rb").read())
f.close()
-DefaultEnvironment()['SCCS'] = r'%s'
+DefaultEnvironment(tools=['SCCS'])['SCCS'] = r'%s'
env = Environment(BUILDERS={'Cat':Builder(action=cat)})
env.Cat('aaa.out', 'aaa.in')
env.Cat('bbb.out', 'bbb.in')
diff --git a/test/ToolSurrogate.py b/test/ToolSurrogate.py
index f33d804..dc190dd 100644
--- a/test/ToolSurrogate.py
+++ b/test/ToolSurrogate.py
@@ -80,22 +80,22 @@ ToolList = {
platform = ARGUMENTS['platform']
tools = map(lambda t: apply(ToolSurrogate, t), ToolList[platform])
-env = Environment(tools = tools)
+env = Environment(tools=tools, PROGSUFFIX='.exe', OBJSUFFIX='.obj')
env.Program('foo.c')
""")
test.write('foo.c', "foo.c posix\n")
test.run(arguments = '. platform=posix', stdout = test.wrap_stdout("""\
-cc -c -o foo.o foo.c
-c++ -o foo foo.o
+cc -c -o foo.obj foo.c
+c++ -o foo.exe foo.obj
"""))
test.write('foo.c', "foo.c win32\n")
test.run(arguments = '. platform=win32', stdout = test.wrap_stdout("""\
-cl /nologo /c foo.c /Fofoo.o
-link /nologo /OUT:foo foo.o
+cl /nologo /c foo.c /Fofoo.obj
+link /nologo /OUT:foo.exe foo.obj
"""))
test.pass_test()