summaryrefslogtreecommitdiff
path: root/test/Deprecated
diff options
context:
space:
mode:
authorGreg Noel <GregNoel@tigris.org>2010-05-21 06:06:27 +0000
committerGreg Noel <GregNoel@tigris.org>2010-05-21 06:06:27 +0000
commit0af7852c0892b4b084f77d9d85f7cd66c3c7dad4 (patch)
tree140962ae0b8ebef170e83e21092fec4f510e91d4 /test/Deprecated
parent4faa9a2a5e62da174fc82cff97d2f6a97e306fec (diff)
downloadscons-0af7852c0892b4b084f77d9d85f7cd66c3c7dad4.tar.gz
Update deprecated features to the next life-cycle stage
Diffstat (limited to 'test/Deprecated')
-rw-r--r--test/Deprecated/Copy-Method.py12
-rw-r--r--test/Deprecated/SourceSignatures/basic.py23
-rw-r--r--test/Deprecated/SourceSignatures/env.py16
-rw-r--r--test/Deprecated/SourceSignatures/implicit-cache.py22
-rw-r--r--test/Deprecated/SourceSignatures/no-csigs.py10
-rw-r--r--test/Deprecated/SourceSignatures/overrides.py13
-rw-r--r--test/Deprecated/SourceSignatures/switch-rebuild.py15
-rw-r--r--test/Deprecated/TargetSignatures/build-content.py12
-rw-r--r--test/Deprecated/TargetSignatures/content.py16
-rw-r--r--test/Deprecated/TargetSignatures/overrides.py10
-rw-r--r--test/Deprecated/TaskmasterNeedsExecute.py17
11 files changed, 82 insertions, 84 deletions
diff --git a/test/Deprecated/Copy-Method.py b/test/Deprecated/Copy-Method.py
index 3864b163..69096665 100644
--- a/test/Deprecated/Copy-Method.py
+++ b/test/Deprecated/Copy-Method.py
@@ -38,16 +38,8 @@ env = Environment().Copy()
env.Copy()
""")
-expect = """
-scons: warning: The env.Copy() method is deprecated; use the env.Clone() method instead.
-"""
-
-test.run(arguments = '.',
- stderr = TestSCons.re_escape(expect) + TestSCons.file_expr)
-
-test.run(arguments = '--warn=no-deprecated .')
-
-test.run(arguments = '--warn=no-deprecated-copy .')
+msg = """The env.Copy() method is deprecated; use the env.Clone() method instead."""
+test.deprecated_warning('deprecated-copy', msg)
test.pass_test()
diff --git a/test/Deprecated/SourceSignatures/basic.py b/test/Deprecated/SourceSignatures/basic.py
index 1340bc4a..c762a737 100644
--- a/test/Deprecated/SourceSignatures/basic.py
+++ b/test/Deprecated/SourceSignatures/basic.py
@@ -32,9 +32,8 @@ import TestSCons
test = TestSCons.TestSCons(match = TestSCons.match_re_dotall)
-
base_sconstruct_contents = """\
-SetOption('warn', 'no-deprecated-source-signatures')
+SetOption('warn', 'deprecated-source-signatures')
def build(env, target, source):
open(str(target[0]), 'wt').write(open(str(source[0]), 'rt').read())
B = Builder(action = build)
@@ -52,6 +51,10 @@ def write_SConstruct(test, sigtype):
test.write('SConstruct', contents)
+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
write_SConstruct(test, 'timestamp')
@@ -60,8 +63,7 @@ test.write('f2.in', "f2.in\n")
test.write('f3.in', "f3.in\n")
test.write('f4.in', "f4.in\n")
-test.run(arguments = 'f1.out f3.out',
- stderr = TestSCons.deprecated_python_expr)
+test.run(arguments = 'f1.out f3.out', stderr = expect)
test.run(arguments = 'f1.out f2.out f3.out f4.out',
stdout = re.escape(test.wrap_stdout("""\
@@ -70,8 +72,7 @@ build(["f2.out"], ["f2.in"])
scons: `f3.out' is up to date.
build(["f4.out"], ["f4.in"])
""")),
- stderr = TestSCons.deprecated_python_expr)
-
+ stderr = expect)
os.utime(test.workpath('f1.in'),
@@ -88,8 +89,7 @@ scons: `f2.out' is up to date.
build(["f3.out"], ["f3.in"])
scons: `f4.out' is up to date.
""")),
- stderr = TestSCons.deprecated_python_expr)
-
+ stderr = expect)
# Switching to content signatures from timestamps should rebuild,
@@ -97,9 +97,7 @@ scons: `f4.out' is up to date.
write_SConstruct(test, 'MD5')
-test.not_up_to_date(arguments = 'f1.out f2.out f3.out f4.out',
- stderr = TestSCons.deprecated_python_expr)
-
+test.not_up_to_date(arguments = 'f1.out f2.out f3.out f4.out', stderr = expect)
test.sleep()
@@ -112,20 +110,17 @@ test.write('f4.in', "f4.in\n")
test.up_to_date(arguments = 'f1.out f2.out f3.out f4.out', stderr = None)
-
test.touch('f1.in', os.path.getmtime(test.workpath('f1.in'))+10)
test.touch('f3.in', os.path.getmtime(test.workpath('f3.in'))+10)
test.up_to_date(arguments = 'f1.out f2.out f3.out f4.out', stderr = None)
-
write_SConstruct(test, None)
test.up_to_date(arguments = 'f1.out f2.out f3.out f4.out', stderr = None)
-
test.pass_test()
# Local Variables:
diff --git a/test/Deprecated/SourceSignatures/env.py b/test/Deprecated/SourceSignatures/env.py
index b2d6241b..48511403 100644
--- a/test/Deprecated/SourceSignatures/env.py
+++ b/test/Deprecated/SourceSignatures/env.py
@@ -37,7 +37,7 @@ import TestSCons
test = TestSCons.TestSCons(match = TestSCons.match_re_dotall)
base_sconstruct_contents = """\
-SetOption('warn', 'no-deprecated-source-signatures')
+SetOption('warn', 'deprecated-source-signatures')
def build(env, target, source):
open(str(target[0]), 'wt').write(open(str(source[0]), 'rt').read())
B = Builder(action = build)
@@ -57,6 +57,11 @@ def write_SConstruct(test, env_sigtype, default_sigtype):
test.write('SConstruct', contents)
+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
+
write_SConstruct(test, 'MD5', 'timestamp')
@@ -65,8 +70,7 @@ test.write('f2.in', "f2.in\n")
test.write('f3.in', "f3.in\n")
test.write('f4.in', "f4.in\n")
-test.run(arguments = 'f1.out f3.out',
- stderr = TestSCons.deprecated_python_expr)
+test.run(arguments = 'f1.out f3.out', stderr = expect)
test.run(arguments = 'f1.out f2.out f3.out f4.out',
stdout = re.escape(test.wrap_stdout("""\
@@ -75,8 +79,7 @@ build(["f2.out"], ["f2.in"])
scons: `f3.out' is up to date.
build(["f4.out"], ["f4.in"])
""")),
- stderr = TestSCons.deprecated_python_expr)
-
+ stderr = expect)
test.sleep()
@@ -91,12 +94,11 @@ scons: `f2.out' is up to date.
scons: `f3.out' is up to date.
scons: `f4.out' is up to date.
""")),
- stderr = TestSCons.deprecated_python_expr)
+ stderr = expect)
test.up_to_date(arguments = 'f1.out f2.out f3.out f4.out', stderr = None)
-
test.pass_test()
# Local Variables:
diff --git a/test/Deprecated/SourceSignatures/implicit-cache.py b/test/Deprecated/SourceSignatures/implicit-cache.py
index 3911e25a..ee43ae48 100644
--- a/test/Deprecated/SourceSignatures/implicit-cache.py
+++ b/test/Deprecated/SourceSignatures/implicit-cache.py
@@ -36,7 +36,7 @@ import TestSCons
test = TestSCons.TestSCons(match = TestSCons.match_re_dotall)
test.write('SConstruct', """\
-SetOption('warn', 'no-deprecated-source-signatures')
+SetOption('warn', 'deprecated-source-signatures')
SetOption('implicit_cache', 1)
SourceSignatures('timestamp')
@@ -47,16 +47,20 @@ env = Environment(BUILDERS = { 'B' : B })
env.B(target = 'both.out', source = 'both.in')
""")
-both_out_both_in = re.escape(test.wrap_stdout('build(["both.out"], ["both.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
+both_out_both_in = re.escape(test.wrap_stdout('build(["both.out"], ["both.in"])\n'))
test.write('both.in', "both.in 1\n")
test.run(arguments = 'both.out',
stdout = both_out_both_in,
- stderr = TestSCons.deprecated_python_expr)
-
+ stderr = expect)
test.sleep(2)
@@ -65,8 +69,7 @@ test.write('both.in', "both.in 2\n")
test.run(arguments = 'both.out',
stdout = both_out_both_in,
- stderr = TestSCons.deprecated_python_expr)
-
+ stderr = expect)
test.sleep(2)
@@ -75,8 +78,7 @@ test.write('both.in', "both.in 3\n")
test.run(arguments = 'both.out',
stdout = both_out_both_in,
- stderr = TestSCons.deprecated_python_expr)
-
+ stderr = expect)
test.sleep(2)
@@ -85,8 +87,7 @@ test.write('both.in', "both.in 4\n")
test.run(arguments = 'both.out',
stdout = both_out_both_in,
- stderr = TestSCons.deprecated_python_expr)
-
+ stderr = expect)
test.sleep(2)
@@ -94,7 +95,6 @@ test.sleep(2)
test.up_to_date(arguments = 'both.out', stderr = None)
-
test.pass_test()
# Local Variables:
diff --git a/test/Deprecated/SourceSignatures/no-csigs.py b/test/Deprecated/SourceSignatures/no-csigs.py
index 5f47d9b3..93ad408c 100644
--- a/test/Deprecated/SourceSignatures/no-csigs.py
+++ b/test/Deprecated/SourceSignatures/no-csigs.py
@@ -34,7 +34,7 @@ test = TestSConsign.TestSConsign(match = TestSConsign.match_re)
test.write('SConstruct', """\
-SetOption('warn', 'no-deprecated-source-signatures')
+SetOption('warn', 'deprecated-source-signatures')
def build(env, target, source):
open(str(target[0]), 'wt').write(open(str(source[0]), 'rt').read())
B = Builder(action = build)
@@ -47,9 +47,12 @@ SourceSignatures('timestamp')
test.write('f1.in', "f1.in\n")
test.write('f2.in', "f2.in\n")
-test.run(arguments = '.',
- stderr = TestSCons.deprecated_python_expr)
+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
+test.run(arguments = '.', stderr = expect)
expect = r"""=== .:
@@ -68,7 +71,6 @@ test.run_sconsign(arguments = test.workpath('.sconsign'),
stdout = expect)
-
test.pass_test()
# Local Variables:
diff --git a/test/Deprecated/SourceSignatures/overrides.py b/test/Deprecated/SourceSignatures/overrides.py
index 63ee095a..78e7bad4 100644
--- a/test/Deprecated/SourceSignatures/overrides.py
+++ b/test/Deprecated/SourceSignatures/overrides.py
@@ -36,8 +36,13 @@ import TestSCons
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
+
test.write('SConstruct', """\
-SetOption('warn', 'no-deprecated-source-signatures')
+SetOption('warn', 'deprecated-source-signatures')
DefaultEnvironment().SourceSignatures('MD5')
env = Environment()
env.SourceSignatures('timestamp')
@@ -46,15 +51,13 @@ env.Command('foo.out', 'foo.in', Copy('$TARGET', '$SOURCE'), FOO=1)
test.write('foo.in', "foo.in 1\n")
-test.run(arguments = 'foo.out',
- stderr = TestSCons.deprecated_python_expr)
+test.run(arguments = 'foo.out', stderr = expect)
test.sleep()
test.write('foo.in', "foo.in 1\n")
-test.not_up_to_date(arguments = 'foo.out',
- stderr = TestSCons.deprecated_python_expr)
+test.not_up_to_date(arguments = 'foo.out', stderr = expect)
test.pass_test()
diff --git a/test/Deprecated/SourceSignatures/switch-rebuild.py b/test/Deprecated/SourceSignatures/switch-rebuild.py
index c8e64e39..70ebfbe5 100644
--- a/test/Deprecated/SourceSignatures/switch-rebuild.py
+++ b/test/Deprecated/SourceSignatures/switch-rebuild.py
@@ -34,9 +34,14 @@ import TestSCons
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
+
base_sconstruct_contents = """\
-SetOption('warn', 'no-deprecated-source-signatures')
+SetOption('warn', 'deprecated-source-signatures')
SourceSignatures('%s')
def build(env, target, source):
@@ -59,30 +64,26 @@ switch_out_switch_in = re.escape(test.wrap_stdout('build(["switch.out"], ["switc
test.run(arguments = 'switch.out',
stdout = switch_out_switch_in,
- stderr = TestSCons.deprecated_python_expr)
+ stderr = expect)
test.up_to_date(arguments = 'switch.out', stderr = None)
-
write_SConstruct(test, 'timestamp')
test.up_to_date(arguments = 'switch.out', stderr = None)
-
write_SConstruct(test, 'MD5')
test.not_up_to_date(arguments = 'switch.out', stderr = None)
-
test.write('switch.in', "switch.in 2\n")
test.run(arguments = 'switch.out',
stdout = switch_out_switch_in,
- stderr = TestSCons.deprecated_python_expr)
-
+ stderr = expect)
test.pass_test()
diff --git a/test/Deprecated/TargetSignatures/build-content.py b/test/Deprecated/TargetSignatures/build-content.py
index 7cf8ab87..6213ef60 100644
--- a/test/Deprecated/TargetSignatures/build-content.py
+++ b/test/Deprecated/TargetSignatures/build-content.py
@@ -36,10 +36,14 @@ import TestSCons
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
sconstruct_contents = """\
-SetOption('warn', 'no-deprecated-target-signatures')
+SetOption('warn', 'deprecated-target-signatures')
env = Environment()
def copy1(env, source, target):
@@ -81,7 +85,7 @@ copy1(["bar.out"], ["bar.mid"])
copy2(["foo.mid"], ["foo.in"])
copy1(["foo.out"], ["foo.mid"])
""")),
- stderr = TestSCons.deprecated_python_expr)
+ stderr = expect)
test.up_to_date(arguments='bar.out foo.out', stderr=None)
@@ -99,7 +103,7 @@ copy1(["bar.out"], ["bar.mid"])
copy2(["foo.mid"], ["foo.in"])
scons: `foo.out' is up to date.
""")),
- stderr = TestSCons.deprecated_python_expr)
+ stderr = expect)
@@ -124,7 +128,7 @@ scons: `bar.out' is up to date.
copy2(["foo.mid"], ["foo.in"])
copy1(["foo.out"], ["foo.mid"])
""")),
- stderr = TestSCons.deprecated_python_expr)
+ stderr = expect)
diff --git a/test/Deprecated/TargetSignatures/content.py b/test/Deprecated/TargetSignatures/content.py
index 3b2638f6..5bd1a890 100644
--- a/test/Deprecated/TargetSignatures/content.py
+++ b/test/Deprecated/TargetSignatures/content.py
@@ -33,11 +33,18 @@ import TestSCons
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.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
test.write('SConstruct', """\
-SetOption('warn', 'no-deprecated-source-signatures')
-SetOption('warn', 'no-deprecated-target-signatures')
+SetOption('warn', 'deprecated-source-signatures')
+SetOption('warn', 'deprecated-target-signatures')
env = Environment()
def copy(env, source, target):
@@ -67,19 +74,18 @@ test.write('foo.in', "foo.in\n")
test.write('bar.in', "bar.in\n")
test.write('extra.in', "extra.in 1\n")
-test.run(stderr = TestSCons.deprecated_python_expr)
+test.run(stderr = expect)
test.must_match('final', "foo.in\nbar.in\nextra.in 1\n")
test.sleep()
test.write('extra.in', "extra.in 2\n")
-test.run(stderr = TestSCons.deprecated_python_expr)
+test.run(stderr = expect)
test.must_match('final', "foo.in\nbar.in\nextra.in 1\n")
-
test.pass_test()
# Local Variables:
diff --git a/test/Deprecated/TargetSignatures/overrides.py b/test/Deprecated/TargetSignatures/overrides.py
index 055c06be..bc8de341 100644
--- a/test/Deprecated/TargetSignatures/overrides.py
+++ b/test/Deprecated/TargetSignatures/overrides.py
@@ -36,7 +36,7 @@ import TestSCons
test = TestSCons.TestSCons(match = TestSCons.match_re_dotall)
test.write('SConstruct', """\
-SetOption('warn', 'no-deprecated-target-signatures')
+SetOption('warn', 'deprecated-target-signatures')
env = Environment()
env.TargetSignatures('content')
env.Command('foo.out', 'foo.mid', Copy('$TARGET', '$SOURCE'), FOO=1)
@@ -45,8 +45,12 @@ env.Command('foo.mid', 'foo.in', Copy('$TARGET', '$SOURCE'), FOO=2)
test.write('foo.in', "foo.in\n")
-test.run(arguments = '.',
- stderr = TestSCons.deprecated_python_expr)
+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
+
+test.run(arguments = '.', stderr = expect)
test.must_match('foo.mid', "foo.in\n")
test.must_match('foo.out', "foo.in\n")
diff --git a/test/Deprecated/TaskmasterNeedsExecute.py b/test/Deprecated/TaskmasterNeedsExecute.py
index 95e37b22..eb3de407 100644
--- a/test/Deprecated/TaskmasterNeedsExecute.py
+++ b/test/Deprecated/TaskmasterNeedsExecute.py
@@ -40,20 +40,9 @@ task = SCons.Taskmaster.Task(tm, [], True, None)
task.needs_execute()
""")
-expect = """
-scons: warning: Direct use of the Taskmaster.Task class will be deprecated
-\tin a future release.
-"""
-
-test.run(arguments = '.')
-
-test.run(arguments = '--warn=taskmaster-needs-execute .',
- stderr = TestSCons.re_escape(expect) + TestSCons.file_expr)
-
-test.run(arguments = '--warn=no-taskmaster-needs-execute .')
-
-test.run(arguments = '--warn=future-deprecated .',
- stderr = TestSCons.re_escape(expect) + TestSCons.file_expr)
+msg ="""Taskmaster.Task is an abstract base class; instead of
+\tusing it directly, derive from it and override the abstract methods."""
+test.deprecated_warning('taskmaster-needs-execute', msg)
test.pass_test()