summaryrefslogtreecommitdiffstats
path: root/test/option
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/option
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/option')
-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
4 files changed, 20 insertions, 37 deletions
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()