summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorGreg Noel <GregNoel@tigris.org>2010-05-26 16:17:09 (GMT)
committerGreg Noel <GregNoel@tigris.org>2010-05-26 16:17:09 (GMT)
commit545d2a0a389e9eacdb1d92fbf5f26f2d981029ad (patch)
tree23f5cda5c621bd7bb657ef9fd1d07e4578d4a934 /test
parent5c2e07585593ee4994b8e7d79b3d181a56cd7f13 (diff)
downloadSCons-545d2a0a389e9eacdb1d92fbf5f26f2d981029ad.zip
SCons-545d2a0a389e9eacdb1d92fbf5f26f2d981029ad.tar.gz
SCons-545d2a0a389e9eacdb1d92fbf5f26f2d981029ad.tar.bz2
Start the deprecation cycle for the BuildDir() method and the build_dir
keyword parameter. Several existing tests were still using BuildDir() or build_dir; they were converted to use VariantDir() and variant_dir. New tests were added to validate that the --warn=deprecated-build-dir option and the SetOption method did the right thing. This led to the discovery that a commonly-used test pattern provided by the infrastructure gobbled up too much, causing tests to succeed when they should have failed. Fixing the pattern led to other tests needing to be fixed. In the process, it was discovered that the SCONSFLAG environment variable was not getting correctly reset to its original value. Fixing this also caused additional tests to misbehave, requiring them to be updated. And test/Sig.py, which tests the deprecated SCons.Sig module, was moved to the test/Deprecated directory. All in all, quite a lot of action for what was supposed to be a simple change.
Diffstat (limited to 'test')
-rw-r--r--test/CPPPATH/subdir-as-include.py2
-rw-r--r--test/Configure/VariantDir2.py2
-rw-r--r--test/Deprecated/BuildDir.py56
-rw-r--r--test/Deprecated/Options/BoolOption.py3
-rw-r--r--test/Deprecated/SConscript-build_dir.py24
-rw-r--r--test/Deprecated/Sig.py (renamed from test/Sig.py)0
-rw-r--r--test/Deprecated/SourceSignatures/basic.py2
-rw-r--r--test/Deprecated/SourceSignatures/env.py2
-rw-r--r--test/Deprecated/SourceSignatures/implicit-cache.py2
-rw-r--r--test/Deprecated/SourceSignatures/no-csigs.py2
-rw-r--r--test/Deprecated/SourceSignatures/overrides.py2
-rw-r--r--test/Deprecated/SourceSignatures/switch-rebuild.py2
-rw-r--r--test/Deprecated/TargetSignatures/build-content.py2
-rw-r--r--test/Deprecated/TargetSignatures/content.py2
-rw-r--r--test/Deprecated/TargetSignatures/overrides.py2
-rw-r--r--test/Mkdir.py2
-rw-r--r--test/Value.py10
-rw-r--r--test/option/warn-dependency.py11
-rw-r--r--test/option/warn-duplicate-environment.py16
-rw-r--r--test/option/warn-misleading-keywords.py15
-rw-r--r--test/option/warn-missing-sconscript.py15
21 files changed, 95 insertions, 79 deletions
diff --git a/test/CPPPATH/subdir-as-include.py b/test/CPPPATH/subdir-as-include.py
index 1ff70a5..06a1a58 100644
--- a/test/CPPPATH/subdir-as-include.py
+++ b/test/CPPPATH/subdir-as-include.py
@@ -46,7 +46,7 @@ env = Environment(CPPPATH = [Dir('inc1')])
env.Program('prog.cpp')
Export('env')
-SConscript('inc1/SConscript', build_dir='inc1/build', duplicate=0)
+SConscript('inc1/SConscript', variant_dir='inc1/build', duplicate=0)
""")
test.write('prog.cpp', """\
diff --git a/test/Configure/VariantDir2.py b/test/Configure/VariantDir2.py
index 51fa8ca..62b832f 100644
--- a/test/Configure/VariantDir2.py
+++ b/test/Configure/VariantDir2.py
@@ -35,7 +35,7 @@ import TestSCons
test = TestSCons.TestSCons()
test.write('SConstruct', """\
-SConscript('SConscript', build_dir='build', src='.')
+SConscript('SConscript', variant_dir='build', src='.')
""")
test.write('SConscript', """\
diff --git a/test/Deprecated/BuildDir.py b/test/Deprecated/BuildDir.py
index 4918ac0..5fe10c0 100644
--- a/test/Deprecated/BuildDir.py
+++ b/test/Deprecated/BuildDir.py
@@ -27,8 +27,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
Verify that the deprecated BuildDir() function and method still
work to create a variant directory tree (by calling VariantDir()
under the covers).
-
-Note that using BuildDir() does not yet print a deprecation warning.
"""
import TestSCons
@@ -37,6 +35,17 @@ _exe = TestSCons._exe
test = TestSCons.TestSCons()
+test.write('SConstruct', """
+BuildDir('build', 'src')
+""")
+
+msg = """BuildDir() and the build_dir keyword have been deprecated;
+\tuse VariantDir() and the variant_dir keyword instead."""
+test.deprecated_warning('deprecated-build-dir', msg)
+
+warning = '\nscons: warning: ' + TestSCons.re_escape(msg) \
+ + '\n' + TestSCons.file_expr
+
foo11 = test.workpath('work1', 'build', 'var1', 'foo1' + _exe)
foo12 = test.workpath('work1', 'build', 'var1', 'foo2' + _exe)
foo21 = test.workpath('work1', 'build', 'var2', 'foo1' + _exe)
@@ -51,6 +60,7 @@ foo52 = test.workpath('build', 'var5', 'foo2' + _exe)
test.subdir('work1')
test.write(['work1', 'SConstruct'], """
+SetOption('warn', 'deprecated-build-dir')
src = Dir('src')
var2 = Dir('build/var2')
var3 = Dir('build/var3')
@@ -60,12 +70,12 @@ var6 = Dir('../build/var6')
env = Environment(BUILD = 'build', SRC = 'src')
-VariantDir('build/var1', src)
-VariantDir(var2, src)
-VariantDir(var3, src, duplicate=0)
-env.VariantDir("$BUILD/var4", "$SRC", duplicate=0)
-VariantDir(var5, src, duplicate=0)
-VariantDir(var6, src)
+BuildDir('build/var1', src)
+BuildDir(var2, src)
+BuildDir(var3, src, duplicate=0)
+env.BuildDir("$BUILD/var4", "$SRC", duplicate=0)
+BuildDir(var5, src, duplicate=0)
+BuildDir(var6, src)
env = Environment(CPPPATH='#src', FORTRANPATH='#src')
SConscript('build/var1/SConscript', "env")
@@ -185,28 +195,33 @@ test.write(['work1', 'src', 'f4h.in'], r"""
# Some releases of freeBSD seem to have library complaints about
# tempnam(). Filter out these annoying messages before checking for
# error output.
-def blank_output(err):
+def filter_tempnam(err):
if not err:
- return 1
- stderrlines = [l for l in err.split('\n') if l]
+ return ''
msg = "warning: tempnam() possibly used unsafely"
- stderrlines = [l for l in stderrlines if l.find(msg) == -1]
- return len(stderrlines) == 0
+ return '\n'.join([l for l in err.splitlines() if l.find(msg) == -1])
test.run(chdir='work1', arguments = '. ../build', stderr=None)
-test.fail_test(not blank_output(test.stderr()))
+stderr = filter_tempnam(test.stderr())
+test.fail_test(TestSCons.match_re_dotall(stderr, 6*warning))
test.run(program = foo11, stdout = "f1.c\n")
test.run(program = foo12, stdout = "f2.c\n")
test.run(program = foo41, stdout = "f1.c\n")
test.run(program = foo42, stdout = "f2.c\n")
-test.run(chdir='work1', arguments='. ../build', stdout=test.wrap_stdout("""\
+test.run(chdir='work1',
+ arguments='. ../build',
+ stderr = None,
+ stdout=test.wrap_stdout("""\
scons: `.' is up to date.
scons: `%s' is up to date.
""" % test.workpath('build')))
+stderr = filter_tempnam(test.stderr())
+test.fail_test(TestSCons.match_re_dotall(stderr, 6*warning))
+
import os
import stat
def equal_stats(x,y):
@@ -255,7 +270,8 @@ test.write(['work1', 'src', 'f4h.in'], r"""
test.run(chdir='work1', arguments = '../build/var5', stderr=None)
-test.fail_test(not blank_output(test.stderr()))
+stderr = filter_tempnam(test.stderr())
+test.fail_test(TestSCons.match_re_dotall(stderr, 6*warning))
test.run(program = foo51, stdout = "f1.c 2\n")
test.run(program = test.workpath('build', 'var5', 'foo3' + _exe),
@@ -263,10 +279,16 @@ test.run(program = test.workpath('build', 'var5', 'foo3' + _exe),
test.run(program = test.workpath('build', 'var5', 'foo4' + _exe),
stdout = "f4.c 2\n")
-test.run(chdir='work1', arguments='../build/var5', stdout=test.wrap_stdout("""\
+test.run(chdir='work1',
+ arguments='../build/var5',
+ stderr=None,
+ stdout=test.wrap_stdout("""\
scons: `%s' is up to date.
""" % test.workpath('build', 'var5')))
+stderr = filter_tempnam(test.stderr())
+test.fail_test(TestSCons.match_re_dotall(stderr, 6*warning))
+
test.pass_test()
# Local Variables:
diff --git a/test/Deprecated/Options/BoolOption.py b/test/Deprecated/Options/BoolOption.py
index ac2ecdc..563939b 100644
--- a/test/Deprecated/Options/BoolOption.py
+++ b/test/Deprecated/Options/BoolOption.py
@@ -39,8 +39,8 @@ def check(expect):
assert result[1:len(expect)+1] == expect, (result[1:len(expect)+1], expect)
-
test.write(SConstruct_path, """\
+SetOption('warn', 'deprecated-options')
from SCons.Options.BoolOption import BoolOption
BO = BoolOption
@@ -83,7 +83,6 @@ Invalid value for boolean option: irgendwas
test.run(arguments='warnings=irgendwas', stderr=expect_stderr, status=2)
-
test.pass_test()
# Local Variables:
diff --git a/test/Deprecated/SConscript-build_dir.py b/test/Deprecated/SConscript-build_dir.py
index 41b5222..76ff688 100644
--- a/test/Deprecated/SConscript-build_dir.py
+++ b/test/Deprecated/SConscript-build_dir.py
@@ -26,13 +26,24 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
"""
Verify that specifying a build_dir argument to SConscript still works.
-
-Note that the build_dir argument does not yet print a deprecation warning.
"""
import TestSCons
-test = TestSCons.TestSCons()
+test = TestSCons.TestSCons(match = TestSCons.match_re_dotall)
+
+test.write('SConstruct', """
+SConscript('SConscript', build_dir = 'build')
+""")
+
+test.write('SConscript', """
+""")
+
+msg = """The build_dir keyword has been deprecated; use the variant_dir keyword instead."""
+test.deprecated_warning('deprecated-build-dir', msg)
+
+warning = '\nscons: warning: ' + TestSCons.re_escape(msg) \
+ + '\n' + TestSCons.file_expr
all1 = test.workpath('test', 'build', 'var1', 'all')
all2 = test.workpath('test', 'build', 'var2', 'all')
@@ -47,6 +58,7 @@ all9 = test.workpath('test', 'build', 'var9', 'src', 'all')
test.subdir('test')
test.write(['test', 'SConstruct'], """
+SetOption('warn', 'deprecated-build-dir')
src = Dir('src')
alt = Dir('alt')
var1 = Dir('build/var1')
@@ -116,7 +128,7 @@ test.write('test/alt/aaa.in', "test/alt/aaa.in\n")
test.write('test/alt/bbb.in', "test/alt/bbb.in\n")
test.write('test/alt/ccc.in', "test/alt/ccc.in\n")
-test.run(chdir='test', arguments = '. ../build')
+test.run(chdir='test', arguments = '. ../build', stderr = 7*warning)
all_src = "test/src/aaa.in\ntest/src/bbb.in\ntest/src/ccc.in\n"
all_alt = "test/alt/aaa.in\ntest/alt/bbb.in\ntest/alt/ccc.in\n"
@@ -236,7 +248,7 @@ main(int argc, char *argv[]) {
}
""")
-test.run(chdir="test2")
+test.run(chdir="test2", stderr = warning)
_obj = TestSCons._obj
@@ -267,7 +279,7 @@ test.write(['test3', 'src', 'file.in'], "file.in\n")
test.write(['test3', 'src', '_glscry', 'file.in'], "file.in\n")
-test.run(chdir='test3')
+test.run(chdir='test3', stderr = warning)
test.pass_test()
diff --git a/test/Sig.py b/test/Deprecated/Sig.py
index 1ae118b..1ae118b 100644
--- a/test/Sig.py
+++ b/test/Deprecated/Sig.py
diff --git a/test/Deprecated/SourceSignatures/basic.py b/test/Deprecated/SourceSignatures/basic.py
index c762a73..52a2c5c 100644
--- a/test/Deprecated/SourceSignatures/basic.py
+++ b/test/Deprecated/SourceSignatures/basic.py
@@ -54,7 +54,7 @@ def write_SConstruct(test, sigtype):
expect = TestSCons.re_escape("""
scons: warning: The env.SourceSignatures() method is deprecated;
\tconvert your build to use the env.Decider() method instead.
-""") + TestSCons.file_expr + TestSCons.deprecated_python_expr
+""") + TestSCons.file_expr
write_SConstruct(test, 'timestamp')
diff --git a/test/Deprecated/SourceSignatures/env.py b/test/Deprecated/SourceSignatures/env.py
index 4851140..bb76ff4 100644
--- a/test/Deprecated/SourceSignatures/env.py
+++ b/test/Deprecated/SourceSignatures/env.py
@@ -60,7 +60,7 @@ def write_SConstruct(test, env_sigtype, default_sigtype):
expect = TestSCons.re_escape("""
scons: warning: The env.SourceSignatures() method is deprecated;
\tconvert your build to use the env.Decider() method instead.
-""") + TestSCons.file_expr + TestSCons.deprecated_python_expr
+""") + TestSCons.file_expr
write_SConstruct(test, 'MD5', 'timestamp')
diff --git a/test/Deprecated/SourceSignatures/implicit-cache.py b/test/Deprecated/SourceSignatures/implicit-cache.py
index ee43ae4..af6aa49 100644
--- a/test/Deprecated/SourceSignatures/implicit-cache.py
+++ b/test/Deprecated/SourceSignatures/implicit-cache.py
@@ -51,7 +51,7 @@ env.B(target = 'both.out', source = 'both.in')
expect = TestSCons.re_escape("""
scons: warning: The env.SourceSignatures() method is deprecated;
\tconvert your build to use the env.Decider() method instead.
-""") + TestSCons.file_expr + TestSCons.deprecated_python_expr
+""") + TestSCons.file_expr
both_out_both_in = re.escape(test.wrap_stdout('build(["both.out"], ["both.in"])\n'))
diff --git a/test/Deprecated/SourceSignatures/no-csigs.py b/test/Deprecated/SourceSignatures/no-csigs.py
index 93ad408..f815538 100644
--- a/test/Deprecated/SourceSignatures/no-csigs.py
+++ b/test/Deprecated/SourceSignatures/no-csigs.py
@@ -50,7 +50,7 @@ test.write('f2.in', "f2.in\n")
expect = TestSCons.re_escape("""
scons: warning: The env.SourceSignatures() method is deprecated;
\tconvert your build to use the env.Decider() method instead.
-""") + TestSCons.file_expr + TestSCons.deprecated_python_expr
+""") + TestSCons.file_expr
test.run(arguments = '.', stderr = expect)
diff --git a/test/Deprecated/SourceSignatures/overrides.py b/test/Deprecated/SourceSignatures/overrides.py
index 78e7bad..4303c0e 100644
--- a/test/Deprecated/SourceSignatures/overrides.py
+++ b/test/Deprecated/SourceSignatures/overrides.py
@@ -39,7 +39,7 @@ test = TestSCons.TestSCons(match = TestSCons.match_re_dotall)
expect = TestSCons.re_escape("""
scons: warning: The env.SourceSignatures() method is deprecated;
\tconvert your build to use the env.Decider() method instead.
-""") + TestSCons.file_expr + TestSCons.deprecated_python_expr
+""") + TestSCons.file_expr
test.write('SConstruct', """\
SetOption('warn', 'deprecated-source-signatures')
diff --git a/test/Deprecated/SourceSignatures/switch-rebuild.py b/test/Deprecated/SourceSignatures/switch-rebuild.py
index 70ebfbe..e8af27a 100644
--- a/test/Deprecated/SourceSignatures/switch-rebuild.py
+++ b/test/Deprecated/SourceSignatures/switch-rebuild.py
@@ -37,7 +37,7 @@ test = TestSCons.TestSCons(match = TestSCons.match_re_dotall)
expect = TestSCons.re_escape("""
scons: warning: The env.SourceSignatures() method is deprecated;
\tconvert your build to use the env.Decider() method instead.
-""") + TestSCons.file_expr + TestSCons.deprecated_python_expr
+""") + TestSCons.file_expr
base_sconstruct_contents = """\
diff --git a/test/Deprecated/TargetSignatures/build-content.py b/test/Deprecated/TargetSignatures/build-content.py
index 6213ef6..6a5a8c4 100644
--- a/test/Deprecated/TargetSignatures/build-content.py
+++ b/test/Deprecated/TargetSignatures/build-content.py
@@ -39,7 +39,7 @@ test = TestSCons.TestSCons(match = TestSCons.match_re_dotall)
expect = TestSCons.re_escape("""
scons: warning: The env.TargetSignatures() method is deprecated;
\tconvert your build to use the env.Decider() method instead.
-""") + TestSCons.file_expr + TestSCons.deprecated_python_expr
+""") + TestSCons.file_expr
sconstruct_contents = """\
diff --git a/test/Deprecated/TargetSignatures/content.py b/test/Deprecated/TargetSignatures/content.py
index 5bd1a89..2cd90ec 100644
--- a/test/Deprecated/TargetSignatures/content.py
+++ b/test/Deprecated/TargetSignatures/content.py
@@ -39,7 +39,7 @@ scons: warning: The env.SourceSignatures() method is deprecated;
""") + TestSCons.file_expr + TestSCons.re_escape("""
scons: warning: The env.TargetSignatures() method is deprecated;
\tconvert your build to use the env.Decider() method instead.
-""") + TestSCons.file_expr + TestSCons.deprecated_python_expr
+""") + TestSCons.file_expr
test.write('SConstruct', """\
diff --git a/test/Deprecated/TargetSignatures/overrides.py b/test/Deprecated/TargetSignatures/overrides.py
index bc8de34..54a66d4 100644
--- a/test/Deprecated/TargetSignatures/overrides.py
+++ b/test/Deprecated/TargetSignatures/overrides.py
@@ -48,7 +48,7 @@ test.write('foo.in', "foo.in\n")
expect = TestSCons.re_escape("""
scons: warning: The env.TargetSignatures() method is deprecated;
\tconvert your build to use the env.Decider() method instead.
-""") + TestSCons.file_expr + TestSCons.deprecated_python_expr
+""") + TestSCons.file_expr
test.run(arguments = '.', stderr = expect)
diff --git a/test/Mkdir.py b/test/Mkdir.py
index dbeecb7..4d309bb 100644
--- a/test/Mkdir.py
+++ b/test/Mkdir.py
@@ -159,7 +159,7 @@ test.write(['work3', 'SConstruct'], """\
#/SConstruct ------------------------------------------
import os
env = Environment(ENV = os.environ)
-BuildDir('build', 'sub1', duplicate=0)
+VariantDir('build', 'sub1', duplicate=0)
base = '#build/sub1'
Export('env base')
SConscript('sub1/SConscript', exports='env')
diff --git a/test/Value.py b/test/Value.py
index 06cce40..f3ad458 100644
--- a/test/Value.py
+++ b/test/Value.py
@@ -97,7 +97,7 @@ for source_signature in ['MD5', 'timestamp-newer']:
#" <- unconfuses emacs syntax highlighting
test.must_contain_all_lines(test.stdout(), [out1, out2, out7, out8])
- print test.stdout()
+ #print test.stdout()
test.fail_test(re.search(out3, test.stdout()) == None)
test.must_match('f1.out', "/usr/local")
@@ -108,7 +108,7 @@ for source_signature in ['MD5', 'timestamp-newer']:
test.up_to_date(arguments='.')
- test.run(arguments='prefix=/usr')
+ test.run(options='prefix=/usr')
out4 = """create(["f1.out"], ['/usr'])"""
out5 = """create(["f2.out"], [4])"""
out6 = """create\\(\\["f3.out"\\], \\[<.*.Custom (instance|object) at """
@@ -121,18 +121,18 @@ for source_signature in ['MD5', 'timestamp-newer']:
test.must_match('f3.out', "C=/usr")
test.must_match('f4.out', '4')
- test.up_to_date('prefix=/usr', '.')
+ test.up_to_date(options='prefix=/usr', arguments='.')
test.unlink('f3.out')
- test.run(arguments='prefix=/var')
+ test.run(options='prefix=/var')
out4 = """create(["f1.out"], ['/var'])"""
test.must_contain_all_lines(test.stdout(), [out4, out7, out8])
test.must_not_contain_any_line(test.stdout(), [out5])
test.fail_test(re.search(out6, test.stdout()) == None)
- test.up_to_date('prefix=/var', '.')
+ test.up_to_date(options='prefix=/var', arguments='.')
test.must_match('f1.out', "/var")
test.must_match('f2.out', "4")
diff --git a/test/option/warn-dependency.py b/test/option/warn-dependency.py
index c056278..95d8fed 100644
--- a/test/option/warn-dependency.py
+++ b/test/option/warn-dependency.py
@@ -33,7 +33,6 @@ import TestSCons
test = TestSCons.TestSCons(match = TestSCons.match_re_dotall)
-
test.write("SConstruct", """\
import SCons.Defaults
@@ -51,23 +50,21 @@ test.write("foo.c","""
""")
-
expect = r"""
scons: warning: No dependency generated for file: not_there\.h \(included from: foo\.c\) \-\- file not found
-"""
+""" + TestSCons.file_expr
test.run(arguments='--warn=dependency .',
- stderr=expect + TestSCons.file_expr)
+ stderr=expect)
test.run(arguments='--warn=dependency .',
- stderr=expect + TestSCons.file_expr)
+ stderr=expect)
test.run(arguments='--warn=all --warn=no-dependency .',
stderr=TestSCons.deprecated_python_expr)
test.run(arguments='--warn=no-dependency --warn=all .',
- stderr=TestSCons.deprecated_python_expr + expect + TestSCons.file_expr)
-
+ stderr=TestSCons.deprecated_python_expr + expect)
test.pass_test()
diff --git a/test/option/warn-duplicate-environment.py b/test/option/warn-duplicate-environment.py
index a1c156b..09ced2d 100644
--- a/test/option/warn-duplicate-environment.py
+++ b/test/option/warn-duplicate-environment.py
@@ -33,7 +33,6 @@ import TestSCons
test = TestSCons.TestSCons(match = TestSCons.match_re_dotall)
-
test.write('SConstruct', """
def build(env, target, source):
file = open(str(target[0]), 'wb')
@@ -57,24 +56,19 @@ test.write('file1b.in', 'file1b.in\n')
expect = r"""
scons: warning: Two different environments were specified for target file1.out,
\tbut they appear to have the same action: build\(target, source, env\)
-"""
+""" + TestSCons.file_expr
-test.run(arguments='file1.out',
- stderr=expect + TestSCons.file_expr)
+test.run(arguments='file1.out', stderr=expect)
test.must_match('file1.out', "file1a.in\nfile1b.in\n")
-test.run(arguments='--warn=duplicate-environment file1.out',
- stderr=expect + TestSCons.file_expr)
+test.run(arguments='--warn=duplicate-environment file1.out', stderr=expect)
test.run(arguments='--warn=no-duplicate-environment file1.out')
-test.run(arguments='WARN=duplicate-environment file1.out',
- stderr=expect + TestSCons.file_expr)
-
-test.run(arguments='WARN=no-duplicate-environment file1.out',
- stderr = TestSCons.deprecated_python_expr)
+test.run(arguments='WARN=duplicate-environment file1.out', stderr=expect)
+test.run(arguments='WARN=no-duplicate-environment file1.out')
test.pass_test()
diff --git a/test/option/warn-misleading-keywords.py b/test/option/warn-misleading-keywords.py
index e8b6358..67bc965 100644
--- a/test/option/warn-misleading-keywords.py
+++ b/test/option/warn-misleading-keywords.py
@@ -33,7 +33,6 @@ import TestSCons
test = TestSCons.TestSCons(match = TestSCons.match_re_dotall)
-
test.write('SConstruct', """
def build(env, target, source):
file = open(str(target[0]), 'wb')
@@ -55,25 +54,21 @@ test.write('file3b.out', 'file3b.out\n')
expect = r"""
scons: warning: Did you mean to use `(target|source)' instead of `(targets|sources)'\?
-"""
+""" + TestSCons.file_expr
test.run(arguments='.',
- stderr=expect + TestSCons.file_expr + expect + TestSCons.file_expr)
+ stderr=expect + expect)
test.must_match(['file3a'], 'file3a.in\n')
test.must_match(['file3b'], 'file3b.out\n')
-test.run(arguments='--warn=misleading-keywords .',
- stderr=expect + TestSCons.file_expr + expect + TestSCons.file_expr)
+test.run(arguments='--warn=misleading-keywords .', stderr=expect + expect)
test.run(arguments='--warn=no-misleading-keywords .')
-test.run(arguments='WARN=misleading-keywords .',
- stderr=expect + TestSCons.file_expr + expect + TestSCons.file_expr)
-
-test.run(arguments='WARN=no-misleading-keywords .',
- stderr = TestSCons.deprecated_python_expr)
+test.run(arguments='WARN=misleading-keywords .', stderr=expect + expect)
+test.run(arguments='WARN=no-misleading-keywords .')
test.pass_test()
diff --git a/test/option/warn-missing-sconscript.py b/test/option/warn-missing-sconscript.py
index 9dc5eee..4f1f8bd 100644
--- a/test/option/warn-missing-sconscript.py
+++ b/test/option/warn-missing-sconscript.py
@@ -33,7 +33,6 @@ import TestSCons
test = TestSCons.TestSCons(match = TestSCons.match_re_dotall)
-
test.write("SConstruct", """\
def build(target, source, env):
pass
@@ -51,19 +50,17 @@ test.write("foo.c","""
#include "not_there.h"
""")
-test.run(arguments = '--warn=missing-sconscript .', stderr = r"""
+expect = r"""
scons: warning: Ignoring missing SConscript 'no_such_file'
-""" + TestSCons.file_expr)
+""" + TestSCons.file_expr
-test.run(arguments = '--warn=no-missing-sconscript .', stderr = "")
+test.run(arguments = '--warn=missing-sconscript .', stderr = expect)
-test.run(arguments = 'WARN=missing-sconscript .', stderr = r"""
-scons: warning: Ignoring missing SConscript 'no_such_file'
-""" + TestSCons.file_expr)
+test.run(arguments = '--warn=no-missing-sconscript .', stderr = "")
-test.run(arguments = 'WARN=no-missing-sconscript .',
- stderr = TestSCons.deprecated_python_expr)
+test.run(arguments = 'WARN=missing-sconscript .', stderr = expect)
+test.run(arguments = 'WARN=no-missing-sconscript .')
test.pass_test()