diff options
author | Greg Noel <GregNoel@tigris.org> | 2010-05-28 09:40:40 (GMT) |
---|---|---|
committer | Greg Noel <GregNoel@tigris.org> | 2010-05-28 09:40:40 (GMT) |
commit | 56309561f2396659965eda63b30c69043e17d3f6 (patch) | |
tree | 2a9eaf225729bc320b75e8f0f5f70872b3a72c8f /test | |
parent | 1611fe9bdefe760e4fbfd0a4ae85892a3094e19e (diff) | |
download | SCons-56309561f2396659965eda63b30c69043e17d3f6.zip SCons-56309561f2396659965eda63b30c69043e17d3f6.tar.gz SCons-56309561f2396659965eda63b30c69043e17d3f6.tar.bz2 |
http://scons.tigris.org/issues/show_bug.cgi?id=2365
Start the deprecation cycle for SourceCode() and its related factory functions.
Deprecation messages are added to the functions. Regression tests are modified
to deal with the messages being generated. Documentation is updated.
Diffstat (limited to 'test')
29 files changed, 557 insertions, 257 deletions
diff --git a/test/Deprecated/BuildDir.py b/test/Deprecated/BuildDir.py index 5fe10c0..b0d6610 100644 --- a/test/Deprecated/BuildDir.py +++ b/test/Deprecated/BuildDir.py @@ -35,7 +35,7 @@ _exe = TestSCons._exe test = TestSCons.TestSCons() -test.write('SConstruct', """ +test.write('SConscript', """ BuildDir('build', 'src') """) diff --git a/test/Deprecated/Copy-Method.py b/test/Deprecated/Copy-Method.py index 6909666..2714f64 100644 --- a/test/Deprecated/Copy-Method.py +++ b/test/Deprecated/Copy-Method.py @@ -33,7 +33,7 @@ import TestSCons test = TestSCons.TestSCons(match = TestSCons.match_re_dotall) -test.write('SConstruct', """ +test.write('SConscript', """ env = Environment().Copy() env.Copy() """) diff --git a/test/Deprecated/SConscript-build_dir.py b/test/Deprecated/SConscript-build_dir.py index 76ff688..c9ec07e 100644 --- a/test/Deprecated/SConscript-build_dir.py +++ b/test/Deprecated/SConscript-build_dir.py @@ -32,11 +32,11 @@ import TestSCons test = TestSCons.TestSCons(match = TestSCons.match_re_dotall) -test.write('SConstruct', """ -SConscript('SConscript', build_dir = 'build') +test.write('SConscript', """ +SConscript('DummyScript', build_dir = 'build') """) -test.write('SConscript', """ +test.write('DummyScript', """ """) msg = """The build_dir keyword has been deprecated; use the variant_dir keyword instead.""" diff --git a/test/Deprecated/SourceCode/BitKeeper/BITKEEPERCOM.py b/test/Deprecated/SourceCode/BitKeeper/BITKEEPERCOM.py index d01ad96..eb75a8f 100644 --- a/test/Deprecated/SourceCode/BitKeeper/BITKEEPERCOM.py +++ b/test/Deprecated/SourceCode/BitKeeper/BITKEEPERCOM.py @@ -20,7 +20,6 @@ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" @@ -34,7 +33,17 @@ import TestSCons _python_ = TestSCons._python_ -test = TestSCons.TestSCons() +test = TestSCons.TestSCons(match = TestSCons.match_re_dotall) + +test.write('SConscript', """ +Environment(tools = ['BitKeeper']).BitKeeper() +""") + +msg_bk = """The BitKeeper() factory is deprecated and there is no replacement.""" +warn_bk = test.deprecated_fatal('deprecated-build-dir', msg_bk) +msg_sc = """SourceCode() has been deprecated and there is no replacement. +\tIf you need this function, please contact dev@scons.tigris.org.""" +warn_sc = test.deprecated_wrap(msg_sc) test.subdir('BitKeeper', ['BitKeeper', 'sub'], 'sub') @@ -56,6 +65,7 @@ for f in sys.argv[1:]: """) test.write('SConstruct', """ +SetOption('warn', 'deprecated-source-code') def cat(env, source, target): target = str(target[0]) f = open(target, "wb") @@ -89,11 +99,11 @@ test.write(['BitKeeper', 'sub', 'ddd.in'], "BitKeeper/sub/ddd.in\n") test.write(['sub', 'eee.in'], "checked-out sub/eee.in\n") test.write(['BitKeeper', 'sub', 'fff.in'], "BitKeeper/sub/fff.in\n") -test.run(arguments = '.', - stdout = test.wrap_stdout(read_str = """\ +read_str = """\ %(_python_)s my-bk-get.py %(sub_SConscript)s -""" % locals(), - build_str = """\ +""" % locals() + +build_str = """\ %(_python_)s my-bk-get.py aaa.in cat(["aaa.out"], ["aaa.in"]) cat(["bbb.out"], ["bbb.in"]) @@ -106,7 +116,13 @@ cat(["%(sub_eee_out)s"], ["%(sub_eee_in)s"]) %(_python_)s my-bk-get.py %(sub_fff_in)s cat(["%(sub_fff_out)s"], ["%(sub_fff_in)s"]) cat(["%(sub_all)s"], ["%(sub_ddd_out)s", "%(sub_eee_out)s", "%(sub_fff_out)s"]) -""" % locals())) +""" % locals() + +stdout = test.wrap_stdout(read_str = read_str, build_str = build_str) + +test.run(arguments = '.', + stdout = TestSCons.re_escape(stdout), + stderr = warn_bk + warn_sc) test.must_match('all', "BitKeeper/aaa.in\nchecked-out bbb.in\nBitKeeper/ccc.in\n") @@ -115,8 +131,6 @@ test.must_match(['sub', 'all'], "BitKeeper/sub/ddd.in\nchecked-out sub/eee.in\nBitKeeper/sub/fff.in\n") - -# test.pass_test() # Local Variables: diff --git a/test/Deprecated/SourceCode/BitKeeper/BITKEEPERCOMSTR.py b/test/Deprecated/SourceCode/BitKeeper/BITKEEPERCOMSTR.py index 311ef4d..ca58b83 100644 --- a/test/Deprecated/SourceCode/BitKeeper/BITKEEPERCOMSTR.py +++ b/test/Deprecated/SourceCode/BitKeeper/BITKEEPERCOMSTR.py @@ -20,7 +20,6 @@ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" @@ -34,7 +33,17 @@ import TestSCons _python_ = TestSCons._python_ -test = TestSCons.TestSCons() +test = TestSCons.TestSCons(match = TestSCons.match_re_dotall) + +test.write('SConscript', """ +Environment(tools = ['BitKeeper']).BitKeeper() +""") + +msg_bk = """The BitKeeper() factory is deprecated and there is no replacement.""" +warn_bk = test.deprecated_fatal('deprecated-build-dir', msg_bk) +msg_sc = """SourceCode() has been deprecated and there is no replacement. +\tIf you need this function, please contact dev@scons.tigris.org.""" +warn_sc = test.deprecated_wrap(msg_sc) test.subdir('BitKeeper', ['BitKeeper', 'sub'], 'sub') @@ -56,13 +65,14 @@ for f in sys.argv[1:]: """) test.write('SConstruct', """ +SetOption('warn', 'deprecated-source-code') def cat(env, source, target): target = str(target[0]) f = open(target, "wb") for src in source: f.write(open(str(src), "rb").read()) f.close() -env = Environment(TOOLS = ['default', 'BitKeeper'], +env = Environment(tools = ['default', 'BitKeeper'], BUILDERS={'Cat':Builder(action=cat)}, BITKEEPERCOM='%(_python_)s my-bk-get.py $TARGET', BITKEEPERCOMSTR='Checking out $TARGET from our fake BitKeeper') @@ -90,11 +100,11 @@ test.write(['BitKeeper', 'sub', 'ddd.in'], "BitKeeper/sub/ddd.in\n") test.write(['sub', 'eee.in'], "checked-out sub/eee.in\n") test.write(['BitKeeper', 'sub', 'fff.in'], "BitKeeper/sub/fff.in\n") -test.run(arguments = '.', - stdout = test.wrap_stdout(read_str = """\ +read_str = """\ Checking out %(sub_SConscript)s from our fake BitKeeper -""" % locals(), - build_str = """\ +""" % locals() + +build_str = """\ Checking out aaa.in from our fake BitKeeper cat(["aaa.out"], ["aaa.in"]) cat(["bbb.out"], ["bbb.in"]) @@ -107,7 +117,13 @@ cat(["%(sub_eee_out)s"], ["%(sub_eee_in)s"]) Checking out %(sub_fff_in)s from our fake BitKeeper cat(["%(sub_fff_out)s"], ["%(sub_fff_in)s"]) cat(["%(sub_all)s"], ["%(sub_ddd_out)s", "%(sub_eee_out)s", "%(sub_fff_out)s"]) -""" % locals())) +""" % locals() + +stdout = test.wrap_stdout(read_str = read_str, build_str = build_str) + +test.run(arguments = '.', + stdout = TestSCons.re_escape(stdout), + stderr = warn_bk + warn_sc) test.must_match('all', "BitKeeper/aaa.in\nchecked-out bbb.in\nBitKeeper/ccc.in\n") @@ -116,8 +132,6 @@ test.must_match(['sub', 'all'], "BitKeeper/sub/ddd.in\nchecked-out sub/eee.in\nBitKeeper/sub/fff.in\n") - -# test.pass_test() # Local Variables: diff --git a/test/Deprecated/SourceCode/BitKeeper/BitKeeper.py b/test/Deprecated/SourceCode/BitKeeper/BitKeeper.py index 24b9ccc..28b8761 100644 --- a/test/Deprecated/SourceCode/BitKeeper/BitKeeper.py +++ b/test/Deprecated/SourceCode/BitKeeper/BitKeeper.py @@ -20,7 +20,6 @@ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" @@ -33,10 +32,23 @@ import os import TestSCons test = TestSCons.TestSCons() +test = TestSCons.TestSCons(match = TestSCons.match_re_dotall) + +test.write('SConscript', """ +Environment(tools = ['BitKeeper']).BitKeeper() +""") + +msg_bk = """The BitKeeper() factory is deprecated and there is no replacement.""" +warn_bk = test.deprecated_fatal('deprecated-build-dir', msg_bk) +msg_sc = """SourceCode() has been deprecated and there is no replacement. +\tIf you need this function, please contact dev@scons.tigris.org.""" +warn_sc = test.deprecated_wrap(msg_sc) + +test.skip_test("Need BitKeeper to debug these tests.\n") bk = test.where_is('bk') if not bk: - test.skip_test("Could not find 'bk'; skipping test(s).\n") + test.skip_test("Could not find 'bk'; skipping remaining tests.\n") try: login = os.getlogin() @@ -69,13 +81,13 @@ else: test.unlink(['work1', file]) test.unlink(['work1', ','+file]) - test.write(['work1', 'sub', 'SConscript'], """\ -Import("env") -env.Cat('ddd.out', 'ddd.in') -env.Cat('eee.out', 'eee.in') -env.Cat('fff.out', 'fff.in') -env.Cat('all', ['ddd.out', 'eee.out', 'fff.out']) -""") + test.write(['work1', 'sub', 'SConscript'], """if True: + Import("env") + env.Cat('ddd.out', 'ddd.in') + env.Cat('eee.out', 'eee.in') + env.Cat('fff.out', 'fff.in') + env.Cat('all', ['ddd.out', 'eee.out', 'fff.out']) + """) args = "create SConscript" test.run(chdir = 'work1/sub', program = sccs, arguments = args, stderr = None) test.unlink(['work1', 'sub', 'SConscript']) @@ -88,33 +100,33 @@ env.Cat('all', ['ddd.out', 'eee.out', 'fff.out']) test.unlink(['work1', 'sub', file]) test.unlink(['work1', 'sub', ','+file]) - test.write(['work1', 'SConstruct'], """ -def cat(env, source, target): - target = str(target[0]) - f = open(target, "wb") - for src in source: - f.write(open(str(src), "rb").read()) - f.close() -env = Environment(BUILDERS={'Cat':Builder(action=cat)}, - BITKEEPERGETFLAGS='-e') -env.Cat('aaa.out', 'aaa.in') -env.Cat('bbb.out', 'bbb.in') -env.Cat('ccc.out', 'ccc.in') -env.Cat('all', ['aaa.out', 'bbb.out', 'ccc.out']) -env.SourceCode('.', env.BitKeeper()) -SConscript('sub/SConscript', "env") -""") + test.write(['work1', 'SConstruct'], """if True: + SetOption('warn', 'deprecated-source-code') + def cat(env, source, target): + target = str(target[0]) + f = open(target, "wb") + for src in source: + f.write(open(str(src), "rb").read()) + f.close() + env = Environment(BUILDERS={'Cat':Builder(action=cat)}, + BITKEEPERGETFLAGS='-e') + env.Cat('aaa.out', 'aaa.in') + env.Cat('bbb.out', 'bbb.in') + env.Cat('ccc.out', 'ccc.in') + env.Cat('all', ['aaa.out', 'bbb.out', 'ccc.out']) + env.SourceCode('.', env.BitKeeper()) + SConscript('sub/SConscript', "env") + """) test.write(['work1', 'bbb.in'], "checked-out work1/bbb.in\n") test.write(['work1', 'sub', 'eee.in'], "checked-out work1/sub/eee.in\n") - test.run(chdir = 'work1', - arguments = '.', - stdout = test.wrap_stdout(read_str = """\ + read_str = """\ bk get -e sub/SConscript -""", - build_str = """\ +""" + + build_str = """\ bk get -e aaa.in cat(["aaa.out"], ["aaa.in"]) cat(["bbb.out"], ["bbb.in"]) @@ -127,14 +139,21 @@ cat(["sub/eee.out"], ["sub/eee.in"]) bk get -e sub/fff.in cat(["sub/fff.out"], ["sub/fff.in"]) cat(["sub/all"], ["sub/ddd.out", "sub/eee.out", "sub/fff.out"]) -"""), - stderr = """\ +""" + + stdout = test.wrap_stdout(read_str = read_str, build_str = build_str) + + stderr = """\ sub/SConscript 1.1 -> 1.2: 5 lines aaa.in 1.1 -> 1.2: 1 lines ccc.in 1.1 -> 1.2: 1 lines sub/ddd.in 1.1 -> 1.2: 1 lines sub/fff.in 1.1 -> 1.2: 1 lines -""") +""" + + test.run(arguments = '.', + stdout = TestSCons.re_escape(stdout), + stderr = warn_bk + warn_sc + TestSCons.re_escape(stderr)) test.must_match(['work1', 'all'], "work1/aaa.in\nchecked-out work1/bbb.in\nwork1/ccc.in\n") @@ -187,34 +206,34 @@ env.Cat('all', ['ddd.out', 'eee.out', 'fff.out']) test.no_result(os.path.exists(test.workpath('work2', 'sub', 'eee.in'))) test.no_result(os.path.exists(test.workpath('work2', 'sub', 'fff.in'))) - test.write(['work2', 'SConstruct'], """\ -def cat(env, source, target): - target = str(target[0]) - f = open(target, "wb") - for src in source: - f.write(open(str(src), "rb").read()) - f.close() -env = Environment(BUILDERS={'Cat':Builder(action=cat)}, - BITKEEPERGET='$BITKEEPER co', - BITKEEPERGETFLAGS='-q') -env.Cat('aaa.out', 'aaa.in') -env.Cat('bbb.out', 'bbb.in') -env.Cat('ccc.out', 'ccc.in') -env.Cat('all', ['aaa.out', 'bbb.out', 'ccc.out']) -env.SourceCode('.', env.BitKeeper()) -SConscript('sub/SConscript', "env") -""") + test.write(['work2', 'SConstruct'], """if True: + SetOption('warn', 'deprecated-source-code') + def cat(env, source, target): + target = str(target[0]) + f = open(target, "wb") + for src in source: + f.write(open(str(src), "rb").read()) + f.close() + env = Environment(BUILDERS={'Cat':Builder(action=cat)}, + BITKEEPERGET='$BITKEEPER co', + BITKEEPERGETFLAGS='-q') + env.Cat('aaa.out', 'aaa.in') + env.Cat('bbb.out', 'bbb.in') + env.Cat('ccc.out', 'ccc.in') + env.Cat('all', ['aaa.out', 'bbb.out', 'ccc.out']) + env.SourceCode('.', env.BitKeeper()) + SConscript('sub/SConscript', "env") + """) test.write(['work2', 'bbb.in'], "checked-out work2/bbb.in\n") test.write(['work2', 'sub', 'eee.in'], "checked-out work2/sub/eee.in\n") - test.run(chdir = 'work2', - arguments = '.', - stdout = test.wrap_stdout(read_str = """\ + read_str = """\ bk co -q sub/SConscript -""", - build_str = """\ +""" + + build_str = """\ bk co -q aaa.in cat(["aaa.out"], ["aaa.in"]) cat(["bbb.out"], ["bbb.in"]) @@ -227,7 +246,13 @@ cat(["sub/eee.out"], ["sub/eee.in"]) bk co -q sub/fff.in cat(["sub/fff.out"], ["sub/fff.in"]) cat(["sub/all"], ["sub/ddd.out", "sub/eee.out", "sub/fff.out"]) -""")) +""" + + stdout = test.wrap_stdout(read_str = read_str, build_str = build_str) + + test.run(arguments = '.', + stdout = TestSCons.re_escape(stdout), + stderr = warn_bk + warn_sc) test.must_match(['work2', 'all'], "work2/aaa.in\nchecked-out work2/bbb.in\nwork2/ccc.in\n") @@ -283,6 +308,7 @@ test.run(chdir = 'import', arguments = 'import -q -f -tplain . %s' % test.workpath('work3')) test.write(['work3', 'SConstruct'], """ +SetOption('warn', 'deprecated-source-code') def cat(env, source, target): target = str(target[0]) f = open(target, "wb") @@ -303,12 +329,11 @@ test.write(['work3', 'bbb.in'], "work3/bbb.in\n") test.subdir(['work3', 'sub']) test.write(['work3', 'sub', 'eee.in'], "work3/sub/eee.in\n") -test.run(chdir = 'work3', - arguments = '.', - stdout = test.wrap_stdout(read_str = """\ +read_str = """\ %s get sub/SConscript -""" % bk, - build_str = """\ +""" % bk + +build_str = """\ %s get aaa.in cat(["aaa.out"], ["aaa.in"]) cat(["bbb.out"], ["bbb.in"]) @@ -321,14 +346,22 @@ cat(["sub/eee.out"], ["sub/eee.in"]) %s get sub/fff.in cat(["sub/fff.out"], ["sub/fff.in"]) cat(["sub/all"], ["sub/ddd.out", "sub/eee.out", "sub/fff.out"]) -""" % (bk, bk, bk, bk)), - stderr = """\ +""" % (bk, bk, bk, bk) + +stdout = test.wrap_stdout(read_str = read_str, build_str = build_str) + +stderr = """\ sub/SConscript 1.1: 5 lines aaa.in 1.1: 1 lines ccc.in 1.1: 1 lines sub/ddd.in 1.1: 1 lines sub/fff.in 1.1: 1 lines -""") +""" + +test.run(chdir = 'work3', + arguments = '.', + stdout = TestSCons.re_escape(stdout), + stderr = TestSCons.re_escape(stderr)) test.must_match(['work3', 'all'], "import/aaa.in\nwork3/bbb.in\nimport/ccc.in\n") diff --git a/test/Deprecated/SourceCode/CVS/CVS.py b/test/Deprecated/SourceCode/CVS/CVS.py index eb2553d..b5b51bc 100644 --- a/test/Deprecated/SourceCode/CVS/CVS.py +++ b/test/Deprecated/SourceCode/CVS/CVS.py @@ -20,7 +20,6 @@ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" @@ -32,11 +31,21 @@ import os import TestSCons -test = TestSCons.TestSCons() +test = TestSCons.TestSCons(match = TestSCons.match_re_dotall) + +test.write('SConscript', """ +Environment(tools = ['CVS']).CVS('') +""") + +msg_cvs = """The CVS() factory is deprecated and there is no replacement.""" +warn_cvs = test.deprecated_fatal('deprecated-build-dir', msg_cvs) +msg_sc = """SourceCode() has been deprecated and there is no replacement. +\tIf you need this function, please contact dev@scons.tigris.org.""" +warn_sc = test.deprecated_wrap(msg_sc) cvs = test.where_is('cvs') if not cvs: - test.skip_test("Could not find 'cvs'; skipping test(s).\n") + test.skip_test("Could not find 'cvs'; skipping remaining tests.\n") test.subdir('CVS', 'import', ['import', 'sub'], 'work1', 'work2') @@ -88,6 +97,7 @@ test.run(chdir = 'import', # Test the most straightforward CVS checkouts, using the module name. test.write(['work1', 'SConstruct'], """ +SetOption('warn', 'deprecated-source-code') import os def cat(env, source, target): target = str(target[0]) @@ -113,12 +123,11 @@ test.write(['work1', 'foo', 'bbb.in'], "work1/foo/bbb.in\n") test.subdir(['work1', 'foo', 'sub',]) test.write(['work1', 'foo', 'sub', 'eee.in'], "work1/foo/sub/eee.in\n") -test.run(chdir = 'work1', - arguments = '.', - stdout = test.wrap_stdout(read_str = """\ +read_str = """\ cvs -Q -d %(cvsroot)s co foo/sub/SConscript -""" % locals(), - build_str = """\ +""" % locals() + +build_str = """\ cvs -Q -d %(cvsroot)s co foo/aaa.in cat(["aaa.out"], ["%(foo_aaa_in)s"]) cat(["bbb.out"], ["%(foo_bbb_in)s"]) @@ -131,7 +140,14 @@ cat(["%(foo_sub_eee_out)s"], ["%(foo_sub_eee_in)s"]) cvs -Q -d %(cvsroot)s co foo/sub/fff.in cat(["%(foo_sub_fff_out)s"], ["%(foo_sub_fff_in)s"]) cat(["%(foo_sub_all)s"], ["%(foo_sub_ddd_out)s", "%(foo_sub_eee_out)s", "%(foo_sub_fff_out)s"]) -""" % locals())) +""" % locals() + +stdout = test.wrap_stdout(read_str = read_str, build_str = build_str) + +test.run(chdir = 'work1', + arguments = '.', + stdout = TestSCons.re_escape(stdout), + stderr = warn_cvs + warn_sc) # Checking things back out of CVS apparently messes with the line # endings, so read the result files in non-binary mode. @@ -152,6 +168,7 @@ test.must_be_writable(test.workpath('work1', 'foo', 'sub', 'fff.in')) # Test CVS checkouts when the module name is specified. test.write(['work2', 'SConstruct'], """ +SetOption('warn', 'deprecated-source-code') import os def cat(env, source, target): target = str(target[0]) @@ -176,13 +193,12 @@ test.write(['work2', 'bbb.in'], "work2/bbb.in\n") test.subdir(['work2', 'sub']) test.write(['work2', 'sub', 'eee.in'], "work2/sub/eee.in\n") -test.run(chdir = 'work2', - arguments = '.', - stdout = test.wrap_stdout(read_str = """\ +read_str = """\ cvs -q -d %(cvsroot)s co -d sub foo/sub/SConscript U sub/SConscript -""" % locals(), - build_str = """\ +""" % locals() + +build_str = """\ cvs -q -d %(cvsroot)s co -d . foo/aaa.in U ./aaa.in cat(["aaa.out"], ["aaa.in"]) @@ -199,7 +215,14 @@ cvs -q -d %(cvsroot)s co -d sub foo/sub/fff.in U sub/fff.in cat(["%(sub_fff_out)s"], ["%(sub_fff_in)s"]) cat(["%(sub_all)s"], ["%(sub_ddd_out)s", "%(sub_eee_out)s", "%(sub_fff_out)s"]) -""" % locals())) +""" % locals() + +stdout = test.wrap_stdout(read_str = read_str, build_str = build_str) + +test.run(chdir = 'work2', + arguments = '.', + stdout = TestSCons.re_escape(stdout), + stderr = warn_cvs + warn_sc) # Checking things back out of CVS apparently messes with the line # endings, so read the result files in non-binary mode. @@ -223,6 +246,7 @@ test.must_be_writable(test.workpath('work2', 'sub', 'fff.in')) test.subdir(['work3']) test.write(['work3', 'SConstruct'], """\ +SetOption('warn', 'deprecated-source-code') import os def cat(env, source, target): target = str(target[0]) @@ -240,15 +264,12 @@ env.Cat('bbb.out', 'bbb.in') env.Cat('ccc.out', 'ccc.in') env.Cat('all', ['aaa.out', 'bbb.out', 'ccc.out']) cvs = env.CVS('$CVSROOT', 'foo') -#env.SourceCode('.', cvs) env.SourceCode('aaa.in', cvs) env.SourceCode('bbb.in', cvs) env.SourceCode('ccc.in', cvs) """ % cvsroot) -test.run(chdir = 'work3', - arguments = '.', - stdout = test.wrap_stdout(build_str = """\ +build_str = """\ cvs -q -d %(cvsroot)s co -d . foo/aaa.in U ./aaa.in cat(["aaa.out"], ["aaa.in"]) @@ -259,7 +280,14 @@ cvs -q -d %(cvsroot)s co -d . foo/ccc.in U ./ccc.in cat(["ccc.out"], ["ccc.in"]) cat(["all"], ["aaa.out", "bbb.out", "ccc.out"]) -""" % locals())) +""" % locals() + +stdout = test.wrap_stdout(build_str = build_str) + +test.run(chdir = 'work3', + arguments = '.', + stdout = TestSCons.re_escape(stdout), + stderr = warn_cvs + 3*warn_sc) test.must_match(['work3', 'aaa.out'], "import/aaa.in\n", @@ -278,6 +306,7 @@ test.must_match(['work3', 'all'], #test.subdir(['work4']) # #test.write(['work4', 'SConstruct'], """\ +#SetOption('warn', 'deprecated-source-code') #import os #env = Environment(ENV = { 'PATH' : os.environ['PATH'] }) ## We used to use the SourceForge server, but SourceForge has restrictions diff --git a/test/Deprecated/SourceCode/CVS/CVSCOM.py b/test/Deprecated/SourceCode/CVS/CVSCOM.py index 546e777..b9d9c76 100644 --- a/test/Deprecated/SourceCode/CVS/CVSCOM.py +++ b/test/Deprecated/SourceCode/CVS/CVSCOM.py @@ -20,7 +20,6 @@ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" @@ -34,7 +33,17 @@ import TestSCons _python_ = TestSCons._python_ -test = TestSCons.TestSCons() +test = TestSCons.TestSCons(match = TestSCons.match_re_dotall) + +test.write('SConscript', """ +Environment(tools = ['CVS']).CVS('') +""") + +msg_cvs = """The CVS() factory is deprecated and there is no replacement.""" +warn_cvs = test.deprecated_fatal('deprecated-build-dir', msg_cvs) +msg_sc = """SourceCode() has been deprecated and there is no replacement. +\tIf you need this function, please contact dev@scons.tigris.org.""" +warn_sc = test.deprecated_wrap(msg_sc) test.subdir('CVS', ['CVS', 'sub'], 'sub') @@ -56,6 +65,7 @@ for f in sys.argv[1:]: """) test.write('SConstruct', """ +SetOption('warn', 'deprecated-source-code') def cat(env, source, target): target = str(target[0]) f = open(target, "wb") @@ -89,11 +99,11 @@ test.write(['CVS', 'sub', 'ddd.in'], "CVS/sub/ddd.in\n") test.write(['sub', 'eee.in'], "checked-out sub/eee.in\n") test.write(['CVS', 'sub', 'fff.in'], "CVS/sub/fff.in\n") -test.run(arguments = '.', - stdout = test.wrap_stdout(read_str = """\ +read_str = """\ %(_python_)s my-cvs-co-.py %(sub_SConscript)s -""" % locals(), - build_str = """\ +""" % locals() + +build_str = """\ %(_python_)s my-cvs-co-.py aaa.in cat(["aaa.out"], ["aaa.in"]) cat(["bbb.out"], ["bbb.in"]) @@ -106,7 +116,13 @@ cat(["%(sub_eee_out)s"], ["%(sub_eee_in)s"]) %(_python_)s my-cvs-co-.py %(sub_fff_in)s cat(["%(sub_fff_out)s"], ["%(sub_fff_in)s"]) cat(["%(sub_all)s"], ["%(sub_ddd_out)s", "%(sub_eee_out)s", "%(sub_fff_out)s"]) -""" % locals())) +""" % locals() + +stdout = test.wrap_stdout(read_str = read_str, build_str = build_str) + +test.run(arguments = '.', + stdout = TestSCons.re_escape(stdout), + stderr = warn_cvs + warn_sc) test.must_match('all', "CVS/aaa.in\nchecked-out bbb.in\nCVS/ccc.in\n") @@ -115,8 +131,6 @@ test.must_match(['sub', 'all'], "CVS/sub/ddd.in\nchecked-out sub/eee.in\nCVS/sub/fff.in\n") - -# test.pass_test() # Local Variables: diff --git a/test/Deprecated/SourceCode/CVS/CVSCOMSTR.py b/test/Deprecated/SourceCode/CVS/CVSCOMSTR.py index d45bca6..9a6cf64 100644 --- a/test/Deprecated/SourceCode/CVS/CVSCOMSTR.py +++ b/test/Deprecated/SourceCode/CVS/CVSCOMSTR.py @@ -20,7 +20,6 @@ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" @@ -34,7 +33,17 @@ import TestSCons _python_ = TestSCons._python_ -test = TestSCons.TestSCons() +test = TestSCons.TestSCons(match = TestSCons.match_re_dotall) + +test.write('SConscript', """ +Environment(tools = ['CVS']).CVS('') +""") + +msg_cvs = """The CVS() factory is deprecated and there is no replacement.""" +warn_cvs = test.deprecated_fatal('deprecated-build-dir', msg_cvs) +msg_sc = """SourceCode() has been deprecated and there is no replacement. +\tIf you need this function, please contact dev@scons.tigris.org.""" +warn_sc = test.deprecated_wrap(msg_sc) test.subdir('CVS', ['CVS', 'sub'], 'sub') @@ -56,6 +65,7 @@ for f in sys.argv[1:]: """) test.write('SConstruct', """ +SetOption('warn', 'deprecated-source-code') def cat(env, source, target): target = str(target[0]) f = open(target, "wb") @@ -90,11 +100,11 @@ test.write(['CVS', 'sub', 'ddd.in'], "CVS/sub/ddd.in\n") test.write(['sub', 'eee.in'], "checked-out sub/eee.in\n") test.write(['CVS', 'sub', 'fff.in'], "CVS/sub/fff.in\n") -test.run(arguments = '.', - stdout = test.wrap_stdout(read_str = """\ +read_str = """\ Checking out %(sub_SConscript)s from our fake CVS -""" % locals(), - build_str = """\ +""" % locals() + +build_str = """\ Checking out aaa.in from our fake CVS cat(["aaa.out"], ["aaa.in"]) cat(["bbb.out"], ["bbb.in"]) @@ -107,7 +117,13 @@ cat(["%(sub_eee_out)s"], ["%(sub_eee_in)s"]) Checking out %(sub_fff_in)s from our fake CVS cat(["%(sub_fff_out)s"], ["%(sub_fff_in)s"]) cat(["%(sub_all)s"], ["%(sub_ddd_out)s", "%(sub_eee_out)s", "%(sub_fff_out)s"]) -""" % locals())) +""" % locals() + +stdout = test.wrap_stdout(read_str = read_str, build_str = build_str) + +test.run(arguments = '.', + stdout = TestSCons.re_escape(stdout), + stderr = warn_cvs + warn_sc) test.must_match('all', "CVS/aaa.in\nchecked-out bbb.in\nCVS/ccc.in\n") @@ -116,8 +132,6 @@ test.must_match(['sub', 'all'], "CVS/sub/ddd.in\nchecked-out sub/eee.in\nCVS/sub/fff.in\n") - -# test.pass_test() # Local Variables: diff --git a/test/Deprecated/SourceCode/Perforce/P4COM.py b/test/Deprecated/SourceCode/Perforce/P4COM.py index 5fd5fd2..92ae547 100644 --- a/test/Deprecated/SourceCode/Perforce/P4COM.py +++ b/test/Deprecated/SourceCode/Perforce/P4COM.py @@ -20,7 +20,6 @@ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" @@ -34,7 +33,17 @@ import TestSCons _python_ = TestSCons._python_ -test = TestSCons.TestSCons() +test = TestSCons.TestSCons(match = TestSCons.match_re_dotall) + +test.write('SConscript', """ +Environment(tools = ['Perforce']).Perforce() +""") + +msg_p4 = """The Perforce() factory is deprecated and there is no replacement.""" +warn_p4 = test.deprecated_fatal('deprecated-build-dir', msg_p4) +msg_sc = """SourceCode() has been deprecated and there is no replacement. +\tIf you need this function, please contact dev@scons.tigris.org.""" +warn_sc = test.deprecated_wrap(msg_sc) test.subdir('Perforce', ['Perforce', 'sub'], 'sub') @@ -56,6 +65,7 @@ for f in sys.argv[1:]: """) test.write('SConstruct', """ +SetOption('warn', 'deprecated-source-code') def cat(env, source, target): target = str(target[0]) f = open(target, "wb") @@ -89,11 +99,11 @@ test.write(['Perforce', 'sub', 'ddd.in'], "Perforce/sub/ddd.in\n") test.write(['sub', 'eee.in'], "checked-out sub/eee.in\n") test.write(['Perforce', 'sub', 'fff.in'], "Perforce/sub/fff.in\n") -test.run(arguments = '.', - stdout = test.wrap_stdout(read_str = """\ +read_str = """\ %(_python_)s my-p4.py %(sub_SConscript)s -""" % locals(), - build_str = """\ +""" % locals() + +build_str = """\ %(_python_)s my-p4.py aaa.in cat(["aaa.out"], ["aaa.in"]) cat(["bbb.out"], ["bbb.in"]) @@ -106,7 +116,13 @@ cat(["%(sub_eee_out)s"], ["%(sub_eee_in)s"]) %(_python_)s my-p4.py %(sub_fff_in)s cat(["%(sub_fff_out)s"], ["%(sub_fff_in)s"]) cat(["%(sub_all)s"], ["%(sub_ddd_out)s", "%(sub_eee_out)s", "%(sub_fff_out)s"]) -""" % locals())) +""" % locals() + +stdout = test.wrap_stdout(read_str = read_str, build_str = build_str) + +test.run(arguments = '.', + stdout = TestSCons.re_escape(stdout), + stderr = warn_p4 + warn_sc) test.must_match('all', "Perforce/aaa.in\nchecked-out bbb.in\nPerforce/ccc.in\n") @@ -115,8 +131,6 @@ test.must_match(['sub', 'all'], "Perforce/sub/ddd.in\nchecked-out sub/eee.in\nPerforce/sub/fff.in\n") - -# test.pass_test() # Local Variables: diff --git a/test/Deprecated/SourceCode/Perforce/P4COMSTR.py b/test/Deprecated/SourceCode/Perforce/P4COMSTR.py index accf6d5..d022824 100644 --- a/test/Deprecated/SourceCode/Perforce/P4COMSTR.py +++ b/test/Deprecated/SourceCode/Perforce/P4COMSTR.py @@ -20,7 +20,6 @@ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" @@ -35,6 +34,17 @@ import TestSCons _python_ = TestSCons._python_ test = TestSCons.TestSCons() +test = TestSCons.TestSCons(match = TestSCons.match_re_dotall) + +test.write('SConscript', """ +Environment(tools = ['Perforce']).Perforce() +""") + +msg_p4 = """The Perforce() factory is deprecated and there is no replacement.""" +warn_p4 = test.deprecated_fatal('deprecated-build-dir', msg_p4) +msg_sc = """SourceCode() has been deprecated and there is no replacement. +\tIf you need this function, please contact dev@scons.tigris.org.""" +warn_sc = test.deprecated_wrap(msg_sc) test.subdir('Perforce', ['Perforce', 'sub'], 'sub') @@ -56,6 +66,7 @@ for f in sys.argv[1:]: """) test.write('SConstruct', """ +SetOption('warn', 'deprecated-source-code') def cat(env, source, target): target = str(target[0]) f = open(target, "wb") @@ -90,11 +101,11 @@ test.write(['Perforce', 'sub', 'ddd.in'], "Perforce/sub/ddd.in\n") test.write(['sub', 'eee.in'], "checked-out sub/eee.in\n") test.write(['Perforce', 'sub', 'fff.in'], "Perforce/sub/fff.in\n") -test.run(arguments = '.', - stdout = test.wrap_stdout(read_str = """\ +read_str = """\ Checking out %(sub_SConscript)s from our fake Perforce -""" % locals(), - build_str = """\ +""" % locals() + +build_str = """\ Checking out aaa.in from our fake Perforce cat(["aaa.out"], ["aaa.in"]) cat(["bbb.out"], ["bbb.in"]) @@ -107,7 +118,13 @@ cat(["%(sub_eee_out)s"], ["%(sub_eee_in)s"]) Checking out %(sub_fff_in)s from our fake Perforce cat(["%(sub_fff_out)s"], ["%(sub_fff_in)s"]) cat(["%(sub_all)s"], ["%(sub_ddd_out)s", "%(sub_eee_out)s", "%(sub_fff_out)s"]) -""" % locals())) +""" % locals() + +stdout = test.wrap_stdout(read_str = read_str, build_str = build_str) + +test.run(arguments = '.', + stdout = TestSCons.re_escape(stdout), + stderr = warn_p4 + warn_sc) test.must_match('all', "Perforce/aaa.in\nchecked-out bbb.in\nPerforce/ccc.in\n") @@ -116,8 +133,6 @@ test.must_match(['sub', 'all'], "Perforce/sub/ddd.in\nchecked-out sub/eee.in\nPerforce/sub/fff.in\n") - -# test.pass_test() # Local Variables: diff --git a/test/Deprecated/SourceCode/Perforce/Perforce.py b/test/Deprecated/SourceCode/Perforce/Perforce.py index 32154db..3be5a77 100644 --- a/test/Deprecated/SourceCode/Perforce/Perforce.py +++ b/test/Deprecated/SourceCode/Perforce/Perforce.py @@ -20,7 +20,6 @@ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" @@ -35,6 +34,20 @@ import os import TestSCons +test = TestSCons.TestSCons() + +test.write('SConscript', """ +Environment(tools = ['Perforce']).Perforce() +""") + +msg_p4 = """The Perforce() factory is deprecated and there is no replacement.""" +warn_p4 = test.deprecated_fatal('deprecated-build-dir', msg_p4) +msg_sc = """SourceCode() has been deprecated and there is no replacement. +\tIf you need this function, please contact dev@scons.tigris.org.""" +warn_sc = test.deprecated_wrap(msg_sc) + +test.skip_test("Need Perforce to debug these tests.\n") + class TestPerforce(TestSCons.TestSCons): def __init__(self, *args, **kw): TestSCons.TestSCons.__init__(self, *args, **kw) @@ -237,6 +250,7 @@ test.p4('-c testclient1 opened') test.p4('-c testclient1 submit -i', stdin=changespec) SConstruct_contents = test.substitute(""" +SetOption('warn', 'deprecated-source-code') def cat(env, source, target): target = str(target[0]) f = open(target, "wb") @@ -263,7 +277,7 @@ test.write(['work', 'foo', 'bbb.in'], "work/foo/bbb.in\n") test.subdir(['work', 'foo', 'sub']) test.write(['work', 'foo', 'sub', 'eee.in'], "work/foo/sub/eee.in\n") -test.run(chdir = 'work', arguments = '.') +test.run(chdir = 'work', arguments = '.', stderr = warn_p4 + warn_sc) test.fail_test(test.read(['work', 'all']) != "import/aaa.in\nwork/foo/bbb.in\nimport/ccc.in\n") test.fail_test(test.read(['work', 'foo', 'sub', 'all']) != "import/sub/ddd.in\nwork/foo/sub/eee.in\nimport/sub/fff.in\n") diff --git a/test/Deprecated/SourceCode/RCS/RCS_COCOM.py b/test/Deprecated/SourceCode/RCS/RCS_COCOM.py index a1c18e5..20f0da6 100644 --- a/test/Deprecated/SourceCode/RCS/RCS_COCOM.py +++ b/test/Deprecated/SourceCode/RCS/RCS_COCOM.py @@ -20,7 +20,6 @@ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" @@ -28,13 +27,23 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" Test setting the $RCS_COCOM variable. """ -import os.path +import os import TestSCons _python_ = TestSCons._python_ -test = TestSCons.TestSCons() +test = TestSCons.TestSCons(match = TestSCons.match_re_dotall) + +test.write('SConscript', """ +Environment(tools = ['RCS']).RCS() +""") + +msg_rcs = """The RCS() factory is deprecated and there is no replacement.""" +warn_rcs = test.deprecated_fatal('deprecated-build-dir', msg_rcs) +msg_sc = """SourceCode() has been deprecated and there is no replacement. +\tIf you need this function, please contact dev@scons.tigris.org.""" +warn_sc = test.deprecated_wrap(msg_sc) test.subdir('RCS', ['RCS', 'sub'], 'sub') @@ -56,6 +65,7 @@ for f in sys.argv[1:]: """) test.write('SConstruct', """ +SetOption('warn', 'deprecated-source-code') def cat(env, source, target): target = str(target[0]) f = open(target, "wb") @@ -89,11 +99,11 @@ test.write(['RCS', 'sub', 'ddd.in'], "RCS/sub/ddd.in\n") test.write(['sub', 'eee.in'], "checked-out sub/eee.in\n") test.write(['RCS', 'sub', 'fff.in'], "RCS/sub/fff.in\n") -test.run(arguments = '.', - stdout = test.wrap_stdout(read_str = """\ +read_str = """\ %(_python_)s my-rcs-co.py %(sub_SConscript)s -""" % locals(), - build_str = """\ +""" % locals() + +build_str = """\ %(_python_)s my-rcs-co.py aaa.in cat(["aaa.out"], ["aaa.in"]) cat(["bbb.out"], ["bbb.in"]) @@ -106,7 +116,13 @@ cat(["%(sub_eee_out)s"], ["%(sub_eee_in)s"]) %(_python_)s my-rcs-co.py %(sub_fff_in)s cat(["%(sub_fff_out)s"], ["%(sub_fff_in)s"]) cat(["%(sub_all)s"], ["%(sub_ddd_out)s", "%(sub_eee_out)s", "%(sub_fff_out)s"]) -""" % locals())) +""" % locals() + +stdout = test.wrap_stdout(read_str = read_str, build_str = build_str) + +test.run(arguments = '.', + stdout = TestSCons.re_escape(stdout), + stderr = warn_rcs + warn_sc) test.must_match('all', "RCS/aaa.in\nchecked-out bbb.in\nRCS/ccc.in\n") @@ -115,8 +131,6 @@ test.must_match(['sub', 'all'], "RCS/sub/ddd.in\nchecked-out sub/eee.in\nRCS/sub/fff.in\n") - -# test.pass_test() # Local Variables: diff --git a/test/Deprecated/SourceCode/RCS/RCS_COCOMSTR.py b/test/Deprecated/SourceCode/RCS/RCS_COCOMSTR.py index ee3ba15..3626376 100644 --- a/test/Deprecated/SourceCode/RCS/RCS_COCOMSTR.py +++ b/test/Deprecated/SourceCode/RCS/RCS_COCOMSTR.py @@ -20,7 +20,6 @@ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" @@ -34,7 +33,17 @@ import TestSCons _python_ = TestSCons._python_ -test = TestSCons.TestSCons() +test = TestSCons.TestSCons(match = TestSCons.match_re_dotall) + +test.write('SConscript', """ +Environment(tools = ['RCS']).RCS() +""") + +msg_rcs = """The RCS() factory is deprecated and there is no replacement.""" +warn_rcs = test.deprecated_fatal('deprecated-build-dir', msg_rcs) +msg_sc = """SourceCode() has been deprecated and there is no replacement. +\tIf you need this function, please contact dev@scons.tigris.org.""" +warn_sc = test.deprecated_wrap(msg_sc) test.subdir('RCS', ['RCS', 'sub'], 'sub') @@ -56,6 +65,7 @@ for f in sys.argv[1:]: """) test.write('SConstruct', """ +SetOption('warn', 'deprecated-source-code') def cat(env, source, target): target = str(target[0]) f = open(target, "wb") @@ -90,11 +100,11 @@ test.write(['RCS', 'sub', 'ddd.in'], "RCS/sub/ddd.in\n") test.write(['sub', 'eee.in'], "checked-out sub/eee.in\n") test.write(['RCS', 'sub', 'fff.in'], "RCS/sub/fff.in\n") -test.run(arguments = '.', - stdout = test.wrap_stdout(read_str = """\ +read_str = """\ Checking out %(sub_SConscript)s from our fake RCS -""" % locals(), - build_str = """\ +""" % locals() + +build_str = """\ Checking out aaa.in from our fake RCS cat(["aaa.out"], ["aaa.in"]) cat(["bbb.out"], ["bbb.in"]) @@ -107,7 +117,13 @@ cat(["%(sub_eee_out)s"], ["%(sub_eee_in)s"]) Checking out %(sub_fff_in)s from our fake RCS cat(["%(sub_fff_out)s"], ["%(sub_fff_in)s"]) cat(["%(sub_all)s"], ["%(sub_ddd_out)s", "%(sub_eee_out)s", "%(sub_fff_out)s"]) -""" % locals())) +""" % locals() + +stdout = test.wrap_stdout(read_str = read_str, build_str = build_str) + +test.run(arguments = '.', + stdout = TestSCons.re_escape(stdout), + stderr = warn_rcs + warn_sc) test.must_match('all', "RCS/aaa.in\nchecked-out bbb.in\nRCS/ccc.in\n") @@ -116,8 +132,6 @@ test.must_match(['sub', 'all'], "RCS/sub/ddd.in\nchecked-out sub/eee.in\nRCS/sub/fff.in\n") - -# test.pass_test() # Local Variables: diff --git a/test/Deprecated/SourceCode/RCS/changed.py b/test/Deprecated/SourceCode/RCS/changed.py index d451be0..14c80bd 100644 --- a/test/Deprecated/SourceCode/RCS/changed.py +++ b/test/Deprecated/SourceCode/RCS/changed.py @@ -20,7 +20,6 @@ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" @@ -30,7 +29,17 @@ Test explicit checkouts from local RCS files. import TestSCons -test = TestSCons.TestSCons() +test = TestSCons.TestSCons(match = TestSCons.match_re_dotall) + +test.write('SConscript', """ +Environment(tools = ['RCS']).RCS() +""") + +msg_rcs = """The RCS() factory is deprecated and there is no replacement.""" +warn_rcs = test.deprecated_fatal('deprecated-build-dir', msg_rcs) +msg_sc = """SourceCode() has been deprecated and there is no replacement. +\tIf you need this function, please contact dev@scons.tigris.org.""" +warn_sc = test.deprecated_wrap(msg_sc) rcs = test.where_is('rcs') if not rcs: @@ -45,7 +54,6 @@ if not co: test.skip_test("Could not find `co' command, skipping test(s).\n") - main_cpp_contents = """\ #include <stdio.h> #include <stdlib.h> @@ -62,8 +70,8 @@ test.write('main.c', main_cpp_contents % 1) test.run(program = ci, arguments = '-f -tmain.c main.c', stderr = None) - test.write('SConstruct', """ +SetOption('warn', 'deprecated-source-code') import os for key in ['LOGNAME', 'USERNAME', 'USER']: logname = os.environ.get(key) @@ -76,22 +84,20 @@ env2 = env.Clone() env2.Program('main.exe', 'main.c') """) -test.run() +test.run(stderr = warn_rcs + warn_sc) test.run(program = test.workpath('main.exe'), stdout = "main.c 1\n") - - test.run(program = co, arguments = '-l main.c', stderr = None) + test.write('main.c', main_cpp_contents % 2) -test.not_up_to_date(arguments = 'main.exe') +test.not_up_to_date(arguments = 'main.exe', stderr = warn_rcs + warn_sc) test.run(program = test.workpath('main.exe'), stdout = "main.c 2\n") - test.pass_test() # Local Variables: diff --git a/test/Deprecated/SourceCode/RCS/diskcheck.py b/test/Deprecated/SourceCode/RCS/diskcheck.py index 4e7dd24..7183975 100644 --- a/test/Deprecated/SourceCode/RCS/diskcheck.py +++ b/test/Deprecated/SourceCode/RCS/diskcheck.py @@ -20,7 +20,6 @@ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" @@ -34,6 +33,13 @@ import TestSCons test = TestSCons.TestSCons() +test.write('SConscript', """ +Environment(tools = ['RCS']).RCS() +""") + +msg_rcs = """The RCS() factory is deprecated and there is no replacement.""" +test.deprecated_fatal('deprecated-build-dir', msg_rcs) + rcs = test.where_is('rcs') if not rcs: test.skip_test("Could not find 'rcs'; skipping test(s).\n") @@ -43,7 +49,6 @@ if not ci: test.skip_test("Could not find 'ci'; skipping test(s).\n") - sub_RCS = os.path.join('sub', 'RCS') sub_SConscript = os.path.join('sub', 'SConscript') sub_all = os.path.join('sub', 'all') @@ -87,6 +92,7 @@ test.no_result(os.path.exists(test.workpath('sub', 'bbb.in'))) test.no_result(os.path.exists(test.workpath('sub', 'ccc.in'))) test.write('SConstruct', """ +SetOption('warn', 'deprecated-source-code') import os for key in ['LOGNAME', 'USERNAME', 'USER']: logname = os.environ.get(key) @@ -115,7 +121,7 @@ test.write('bbb.in', "checked-out bbb.in\n") test.write(['sub', 'eee.in'], "checked-out sub/eee.in\n") sub_SConscript = os.path.join('sub', 'SConscript') -SConstruct_file_line = test.python_file_line(test.workpath('SConstruct'), 22)[:-1] +SConstruct_file_line = test.python_file_line(test.workpath('SConstruct'), 23)[:-1] expect = """\ @@ -128,11 +134,11 @@ test.run(status=2, stderr=expect) test.run(arguments = '--diskcheck=match,sccs', status=2, stderr=expect) -test.run(arguments = '--diskcheck=rcs', - stdout = test.wrap_stdout(read_str = """\ +read_str = """\ co -l %(sub_SConscript)s -""" % locals(), - build_str = """\ +""" % locals() + +build_str = """\ co -l aaa.in cat(["aaa.out"], ["aaa.in"]) cat(["bbb.out"], ["bbb.in"]) @@ -145,8 +151,11 @@ cat(["%(sub_eee_out)s"], ["%(sub_eee_in)s"]) co -l %(sub_fff_in)s cat(["%(sub_fff_out)s"], ["%(sub_fff_in)s"]) cat(["%(sub_all)s"], ["%(sub_ddd_out)s", "%(sub_eee_out)s", "%(sub_fff_out)s"]) -""" % locals()), - stderr = """\ +""" % locals() + +stdout = test.wrap_stdout(read_str = read_str, build_str = build_str) + +stderr = """\ %(sub_RCS)s/SConscript,v --> %(sub_SConscript)s revision 1.1 (locked) done @@ -162,7 +171,9 @@ done %(sub_RCS)s/fff.in,v --> %(sub_fff_in)s revision 1.1 (locked) done -""" % locals()) +""" % locals() + +test.run(arguments = '--diskcheck=rcs', stdout = stdout, stderr = stderr) # Checking things back out of RCS apparently messes with the line # endings, so read the result files in non-binary mode. @@ -182,8 +193,6 @@ test.must_be_writable(test.workpath('sub', 'ddd.in')) test.must_be_writable(test.workpath('sub', 'fff.in')) - -# test.pass_test() # Local Variables: diff --git a/test/Deprecated/SourceCode/RCS/explicit.py b/test/Deprecated/SourceCode/RCS/explicit.py index 75eb189..53c336a 100644 --- a/test/Deprecated/SourceCode/RCS/explicit.py +++ b/test/Deprecated/SourceCode/RCS/explicit.py @@ -20,7 +20,6 @@ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" @@ -32,7 +31,17 @@ import os import TestSCons -test = TestSCons.TestSCons() +test = TestSCons.TestSCons(match = TestSCons.match_re_dotall) + +test.write('SConscript', """ +Environment(tools = ['RCS']).RCS() +""") + +msg_rcs = """The RCS() factory is deprecated and there is no replacement.""" +warn_rcs = test.deprecated_fatal('deprecated-build-dir', msg_rcs) +msg_sc = """SourceCode() has been deprecated and there is no replacement. +\tIf you need this function, please contact dev@scons.tigris.org.""" +warn_sc = test.deprecated_wrap(msg_sc) rcs = test.where_is('rcs') if not rcs: @@ -43,7 +52,6 @@ if not ci: test.skip_test("Could not find `ci' command, skipping test(s).\n") - test.subdir('sub') sub_RCS = os.path.join('sub', 'RCS') @@ -87,6 +95,7 @@ test.no_result(os.path.exists(test.workpath('sub', 'eee.in'))) test.no_result(os.path.exists(test.workpath('sub', 'fff.in'))) test.write('SConstruct', """ +SetOption('warn', 'deprecated-source-code') import os for key in ['LOGNAME', 'USERNAME', 'USER']: logname = os.environ.get(key) @@ -115,11 +124,11 @@ test.write('bbb.in', "checked-out bbb.in\n") test.write(['sub', 'eee.in'], "checked-out sub/eee.in\n") -test.run(arguments = '.', - stdout = test.wrap_stdout(read_str = """\ +read_str = """\ co -q %(sub_SConscript)s -""" % locals(), - build_str = """\ +""" % locals() + +build_str = """\ co -q aaa.in cat(["aaa.out"], ["aaa.in"]) cat(["bbb.out"], ["bbb.in"]) @@ -132,7 +141,13 @@ cat(["%(sub_eee_out)s"], ["%(sub_eee_in)s"]) co -q %(sub_fff_in)s cat(["%(sub_fff_out)s"], ["%(sub_fff_in)s"]) cat(["%(sub_all)s"], ["%(sub_ddd_out)s", "%(sub_eee_out)s", "%(sub_fff_out)s"]) -""" % locals())) +""" % locals() + +stdout = test.wrap_stdout(read_str = read_str, build_str = build_str) + +test.run(arguments = '.', + stdout = TestSCons.re_escape(stdout), + stderr = warn_rcs + warn_sc) # Checking things back out of RCS apparently messes with the line # endings, so read the result files in non-binary mode. @@ -152,8 +167,6 @@ test.must_not_be_writable(test.workpath('sub', 'ddd.in')) test.must_not_be_writable(test.workpath('sub', 'fff.in')) - -# test.pass_test() # Local Variables: diff --git a/test/Deprecated/SourceCode/RCS/implicit.py b/test/Deprecated/SourceCode/RCS/implicit.py index 6677c55..ed1f1a2 100644 --- a/test/Deprecated/SourceCode/RCS/implicit.py +++ b/test/Deprecated/SourceCode/RCS/implicit.py @@ -20,7 +20,6 @@ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" @@ -32,6 +31,13 @@ import TestSCons test = TestSCons.TestSCons() +test.write('SConscript', """ +Environment(tools = ['RCS']).RCS() +""") + +msg_rcs = """The RCS() factory is deprecated and there is no replacement.""" +test.deprecated_fatal('deprecated-build-dir', msg_rcs) + rcs = test.where_is('rcs') if not rcs: test.skip_test("Could not find 'rcs'; skipping test(s).\n") @@ -45,7 +51,6 @@ if not co: test.skip_test("Could not find 'co'; skipping test(s).\n") - test.subdir('RCS') test.write('foo.c', """\ @@ -70,6 +75,7 @@ test.run(program = ci, stderr = None) test.write('SConstruct', """ +SetOption('warn', 'deprecated-source-code') DefaultEnvironment(RCS_CO = r'%s') env = Environment() env.Program('foo.c') @@ -85,8 +91,6 @@ done """) - -# test.pass_test() # Local Variables: diff --git a/test/Deprecated/SourceCode/RCS/transparent.py b/test/Deprecated/SourceCode/RCS/transparent.py index 2ebde9a..67d0512 100644 --- a/test/Deprecated/SourceCode/RCS/transparent.py +++ b/test/Deprecated/SourceCode/RCS/transparent.py @@ -20,7 +20,6 @@ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" @@ -34,6 +33,13 @@ import TestSCons test = TestSCons.TestSCons() +test.write('SConscript', """ +Environment(tools = ['RCS']).RCS() +""") + +msg_rcs = """The RCS() factory is deprecated and there is no replacement.""" +test.deprecated_fatal('deprecated-build-dir', msg_rcs) + rcs = test.where_is('rcs') if not rcs: test.skip_test("Could not find 'rcs'; skipping test(s).\n") @@ -43,7 +49,6 @@ if not ci: test.skip_test("Could not find 'ci'; skipping test(s).\n") - sub_RCS = os.path.join('sub', 'RCS') sub_SConscript = os.path.join('sub', 'SConscript') sub_all = os.path.join('sub', 'all') @@ -87,6 +92,7 @@ test.no_result(os.path.exists(test.workpath('sub', 'bbb.in'))) test.no_result(os.path.exists(test.workpath('sub', 'ccc.in'))) test.write('SConstruct', """ +SetOption('warn', 'deprecated-source-code') import os for key in ['LOGNAME', 'USERNAME', 'USER']: logname = os.environ.get(key) @@ -113,11 +119,11 @@ test.write('bbb.in', "checked-out bbb.in\n") test.write(['sub', 'eee.in'], "checked-out sub/eee.in\n") -test.run(arguments = '.', - stdout = test.wrap_stdout(read_str = """\ +read_str = """\ co -l %(sub_SConscript)s -""" % locals(), - build_str = """\ +""" % locals() + +build_str = """\ co -l aaa.in cat(["aaa.out"], ["aaa.in"]) cat(["bbb.out"], ["bbb.in"]) @@ -130,8 +136,11 @@ cat(["%(sub_eee_out)s"], ["%(sub_eee_in)s"]) co -l %(sub_fff_in)s cat(["%(sub_fff_out)s"], ["%(sub_fff_in)s"]) cat(["%(sub_all)s"], ["%(sub_ddd_out)s", "%(sub_eee_out)s", "%(sub_fff_out)s"]) -""" % locals()), - stderr = """\ +""" % locals() + +stdout = test.wrap_stdout(read_str = read_str, build_str = build_str) + +stderr = """\ %(sub_RCS)s/SConscript,v --> %(sub_SConscript)s revision 1.1 (locked) done @@ -147,7 +156,9 @@ done %(sub_RCS)s/fff.in,v --> %(sub_fff_in)s revision 1.1 (locked) done -""" % locals()) +""" % locals() + +test.run(arguments = '.', stdout = stdout, stderr = stderr) # Checking things back out of RCS apparently messes with the line # endings, so read the result files in non-binary mode. @@ -167,8 +178,6 @@ test.must_be_writable(test.workpath('sub', 'ddd.in')) test.must_be_writable(test.workpath('sub', 'fff.in')) - -# test.pass_test() # Local Variables: diff --git a/test/Deprecated/SourceCode/SCCS/SCCSCOM.py b/test/Deprecated/SourceCode/SCCS/SCCSCOM.py index 9d1b649..a08241f 100644 --- a/test/Deprecated/SourceCode/SCCS/SCCSCOM.py +++ b/test/Deprecated/SourceCode/SCCS/SCCSCOM.py @@ -20,7 +20,6 @@ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" @@ -34,7 +33,17 @@ import TestSCons _python_ = TestSCons._python_ -test = TestSCons.TestSCons() +test = TestSCons.TestSCons(match = TestSCons.match_re_dotall) + +test.write('SConscript', """ +Environment(tools = ['SCCS']).SCCS() +""") + +msg_sccs = """The SCCS() factory is deprecated and there is no replacement.""" +warn_sccs = test.deprecated_fatal('deprecated-build-dir', msg_sccs) +msg_sc = """SourceCode() has been deprecated and there is no replacement. +\tIf you need this function, please contact dev@scons.tigris.org.""" +warn_sc = test.deprecated_wrap(msg_sc) test.subdir('SCCS', ['SCCS', 'sub'], 'sub') @@ -56,6 +65,7 @@ for f in sys.argv[1:]: """) test.write('SConstruct', """ +SetOption('warn', 'deprecated-source-code') def cat(env, source, target): target = str(target[0]) f = open(target, "wb") @@ -89,11 +99,11 @@ test.write(['SCCS', 'sub', 'ddd.in'], "SCCS/sub/ddd.in\n") test.write(['sub', 'eee.in'], "checked-out sub/eee.in\n") test.write(['SCCS', 'sub', 'fff.in'], "SCCS/sub/fff.in\n") -test.run(arguments = '.', - stdout = test.wrap_stdout(read_str = """\ +read_str = """\ %(_python_)s my-sccs-get.py %(sub_SConscript)s -""" % locals(), - build_str = """\ +""" % locals() + +build_str = """\ %(_python_)s my-sccs-get.py aaa.in cat(["aaa.out"], ["aaa.in"]) cat(["bbb.out"], ["bbb.in"]) @@ -106,7 +116,13 @@ cat(["%(sub_eee_out)s"], ["%(sub_eee_in)s"]) %(_python_)s my-sccs-get.py %(sub_fff_in)s cat(["%(sub_fff_out)s"], ["%(sub_fff_in)s"]) cat(["%(sub_all)s"], ["%(sub_ddd_out)s", "%(sub_eee_out)s", "%(sub_fff_out)s"]) -""" % locals())) +""" % locals() + +stdout = test.wrap_stdout(read_str = read_str, build_str = build_str) + +test.run(arguments = '.', + stdout = TestSCons.re_escape(stdout), + stderr = warn_sccs + warn_sc) test.must_match('all', "SCCS/aaa.in\nchecked-out bbb.in\nSCCS/ccc.in\n") @@ -115,8 +131,6 @@ test.must_match(['sub', 'all'], "SCCS/sub/ddd.in\nchecked-out sub/eee.in\nSCCS/sub/fff.in\n") - -# test.pass_test() # Local Variables: diff --git a/test/Deprecated/SourceCode/SCCS/SCCSCOMSTR.py b/test/Deprecated/SourceCode/SCCS/SCCSCOMSTR.py index d0da2e4..5204ee3 100644 --- a/test/Deprecated/SourceCode/SCCS/SCCSCOMSTR.py +++ b/test/Deprecated/SourceCode/SCCS/SCCSCOMSTR.py @@ -20,7 +20,6 @@ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" @@ -34,7 +33,17 @@ import TestSCons _python_ = TestSCons._python_ -test = TestSCons.TestSCons() +test = TestSCons.TestSCons(match = TestSCons.match_re_dotall) + +test.write('SConscript', """ +Environment(tools = ['SCCS']).SCCS() +""") + +msg_sccs = """The SCCS() factory is deprecated and there is no replacement.""" +warn_sccs = test.deprecated_fatal('deprecated-build-dir', msg_sccs) +msg_sc = """SourceCode() has been deprecated and there is no replacement. +\tIf you need this function, please contact dev@scons.tigris.org.""" +warn_sc = test.deprecated_wrap(msg_sc) test.subdir('SCCS', ['SCCS', 'sub'], 'sub') @@ -56,13 +65,14 @@ for f in sys.argv[1:]: """) test.write('SConstruct', """ +SetOption('warn', 'deprecated-source-code') def cat(env, source, target): target = str(target[0]) f = open(target, "wb") for src in source: f.write(open(str(src), "rb").read()) f.close() -env = Environment(TOOLS = ['default', 'SCCS'], +env = Environment(tools = ['default', 'SCCS'], BUILDERS={'Cat':Builder(action=cat)}, SCCSCOM='%(_python_)s my-sccs-get.py $TARGET', SCCSCOMSTR='Checking out $TARGET from our fake SCCS') @@ -90,11 +100,11 @@ test.write(['SCCS', 'sub', 'ddd.in'], "SCCS/sub/ddd.in\n") test.write(['sub', 'eee.in'], "checked-out sub/eee.in\n") test.write(['SCCS', 'sub', 'fff.in'], "SCCS/sub/fff.in\n") -test.run(arguments = '.', - stdout = test.wrap_stdout(read_str = """\ +read_str = """\ Checking out %(sub_SConscript)s from our fake SCCS -""" % locals(), - build_str = """\ +""" % locals() + +build_str = """\ Checking out aaa.in from our fake SCCS cat(["aaa.out"], ["aaa.in"]) cat(["bbb.out"], ["bbb.in"]) @@ -107,7 +117,13 @@ cat(["%(sub_eee_out)s"], ["%(sub_eee_in)s"]) Checking out %(sub_fff_in)s from our fake SCCS cat(["%(sub_fff_out)s"], ["%(sub_fff_in)s"]) cat(["%(sub_all)s"], ["%(sub_ddd_out)s", "%(sub_eee_out)s", "%(sub_fff_out)s"]) -""" % locals())) +""" % locals() + +stdout = test.wrap_stdout(read_str = read_str, build_str = build_str) + +test.run(arguments = '.', + stdout = TestSCons.re_escape(stdout), + stderr = warn_sccs + warn_sc) test.must_match('all', "SCCS/aaa.in\nchecked-out bbb.in\nSCCS/ccc.in\n") @@ -116,8 +132,6 @@ test.must_match(['sub', 'all'], "SCCS/sub/ddd.in\nchecked-out sub/eee.in\nSCCS/sub/fff.in\n") - -# test.pass_test() # Local Variables: diff --git a/test/Deprecated/SourceCode/SCCS/diskcheck.py b/test/Deprecated/SourceCode/SCCS/diskcheck.py index a8660bc..774a92c 100644 --- a/test/Deprecated/SourceCode/SCCS/diskcheck.py +++ b/test/Deprecated/SourceCode/SCCS/diskcheck.py @@ -20,7 +20,6 @@ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" @@ -28,18 +27,29 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" Test transparent checkouts from SCCS files in an SCCS subdirectory. """ -import os.path +import os import TestSCons test = TestSCons.TestSCons() +test.write('SConscript', """ +Environment(tools = ['SCCS']).SCCS() +""") + +msg_sccs = """The SCCS() factory is deprecated and there is no replacement.""" +warn_sccs = test.deprecated_fatal('deprecated-build-dir', msg_sccs) +msg_sc = """SourceCode() has been deprecated and there is no replacement. +\tIf you need this function, please contact dev@scons.tigris.org.""" +warn_sc = test.deprecated_wrap(msg_sc) + +test.skip_test("Need SCCS to debug these tests.\n") + sccs = test.where_is('sccs') if not sccs: test.skip_test("Could not find 'sccs'; skipping test(s).\n") - test.subdir('SCCS', 'sub', ['sub', 'SCCS']) for f in ['aaa.in', 'bbb.in', 'ccc.in']: @@ -70,6 +80,7 @@ for f in ['ddd.in', 'eee.in', 'fff.in']: test.unlink(['sub', ','+f]) test.write(['SConstruct'], """ +SetOption('warn', 'deprecated-source-code') DefaultEnvironment()['SCCSCOM'] = 'cd ${TARGET.dir} && $SCCS get ${TARGET.file}' def cat(env, source, target): target = str(target[0]) @@ -92,7 +103,7 @@ test.write(['bbb.in'], "checked-out bbb.in\n") test.write(['sub', 'eee.in'], "checked-out sub/eee.in\n") sub_SConscript = os.path.join('sub', 'SConscript') -SConstruct_file_line = test.python_file_line(test.workpath('SConstruct'), 16)[:-1] +SConstruct_file_line = test.python_file_line(test.workpath('SConstruct'), 17)[:-1] expect = """\ @@ -136,7 +147,6 @@ test.must_not_be_writable(test.workpath('sub', 'ddd.in')) test.must_not_be_writable(test.workpath('sub', 'fff.in')) - test.pass_test() # Local Variables: diff --git a/test/Deprecated/SourceCode/SCCS/explicit.py b/test/Deprecated/SourceCode/SCCS/explicit.py index 252e901..3288425 100644 --- a/test/Deprecated/SourceCode/SCCS/explicit.py +++ b/test/Deprecated/SourceCode/SCCS/explicit.py @@ -20,7 +20,6 @@ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" @@ -32,12 +31,18 @@ import TestSCons test = TestSCons.TestSCons() +test.write('SConscript', """ +Environment(tools = ['SCCS']).SCCS() +""") + +msg_sccs = """The SCCS() factory is deprecated and there is no replacement.""" +test.deprecated_fatal('deprecated-build-dir', msg_sccs) + sccs = test.where_is('sccs') if not sccs: test.skip_test("Could not find 'sccs'; skipping test(s).\n") - test.subdir('SCCS', 'sub', ['sub', 'SCCS']) for f in ['aaa.in', 'bbb.in', 'ccc.in']: @@ -67,6 +72,7 @@ for f in ['ddd.in', 'eee.in', 'fff.in']: test.unlink(['sub', ','+f]) test.write('SConstruct', """ +SetOption('warn', 'deprecated-source-code') def cat(env, source, target): target = str(target[0]) f = open(target, "wb") @@ -121,7 +127,6 @@ test.must_be_writable(test.workpath('sub', 'ddd.in')) test.must_be_writable(test.workpath('sub', 'fff.in')) - test.pass_test() # Local Variables: diff --git a/test/Deprecated/SourceCode/SCCS/implicit.py b/test/Deprecated/SourceCode/SCCS/implicit.py index 3f86841..b3fbf7a 100644 --- a/test/Deprecated/SourceCode/SCCS/implicit.py +++ b/test/Deprecated/SourceCode/SCCS/implicit.py @@ -20,7 +20,6 @@ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" @@ -32,12 +31,18 @@ import TestSCons test = TestSCons.TestSCons() +test.write('SConscript', """ +Environment(tools = ['SCCS']).SCCS() +""") + +msg_sccs = """The SCCS() factory is deprecated and there is no replacement.""" +test.deprecated_fatal('deprecated-build-dir', msg_sccs) + sccs = test.where_is('sccs') if not sccs: test.skip_test("Could not find 'sccs'; skipping test(s).\n") - test.subdir('SCCS') test.write('foo.c', """\ @@ -76,7 +81,6 @@ sccs get foo.h test.must_contain_all_lines(test.stdout(), lines) - test.pass_test() # Local Variables: diff --git a/test/Deprecated/SourceCode/SCCS/transparent.py b/test/Deprecated/SourceCode/SCCS/transparent.py index a8105a2..bc482d0 100644 --- a/test/Deprecated/SourceCode/SCCS/transparent.py +++ b/test/Deprecated/SourceCode/SCCS/transparent.py @@ -20,7 +20,6 @@ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" @@ -32,12 +31,18 @@ import TestSCons test = TestSCons.TestSCons() +test.write('SConscript', """ +Environment(tools = ['SCCS']).SCCS() +""") + +msg_sccs = """The SCCS() factory is deprecated and there is no replacement.""" +test.deprecated_fatal('deprecated-build-dir', msg_sccs) + sccs = test.where_is('sccs') if not sccs: test.skip_test("Could not find 'sccs'; skipping test(s).\n") - test.subdir('SCCS', 'sub', ['sub', 'SCCS']) for f in ['aaa.in', 'bbb.in', 'ccc.in']: @@ -121,7 +126,6 @@ test.must_not_be_writable(test.workpath('sub', 'ddd.in')) test.must_not_be_writable(test.workpath('sub', 'fff.in')) - test.pass_test() # Local Variables: diff --git a/test/Deprecated/SourceCode/SourceCode.py b/test/Deprecated/SourceCode/SourceCode.py index 91af7da..d440581 100644 --- a/test/Deprecated/SourceCode/SourceCode.py +++ b/test/Deprecated/SourceCode/SourceCode.py @@ -20,7 +20,6 @@ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" @@ -32,11 +31,20 @@ import os import TestSCons -test = TestSCons.TestSCons() +test = TestSCons.TestSCons(match = TestSCons.match_re_dotall) + +test.write('SConscript', """ +SourceCode('.', None) +""") + +msg = """SourceCode() has been deprecated and there is no replacement. +\tIf you need this function, please contact dev@scons.tigris.org.""" +warning = test.deprecated_warning('deprecated-source-code', msg) test.subdir('sub', 'sub2') test.write('SConstruct', """\ +SetOption('warn', 'deprecated-source-code') import os def cat(env, source, target): @@ -74,11 +82,11 @@ test.write(['sub2', 'sc-ddd.in'], "sub2/sc-ddd.in\n") test.write(['sub', 'sc-SConscript'], "'sub/sc-SConscript'\n") -test.run(arguments = '.', - stdout = test.wrap_stdout(read_str = """\ +read_str = """\ sc_cat(["%s"], []) -""" % (os.path.join('sub', 'SConscript')), - build_str = """\ +""" % (os.path.join('sub', 'SConscript')) + +build_str = """\ sc_cat(["%s"], []) cat(["aaa.out"], ["%s"]) sc_cat(["%s"], []) @@ -95,7 +103,12 @@ cat(["ddd.out"], ["%s"]) os.path.join('sub', 'ccc.in'), os.path.join('sub', 'ccc.in'), os.path.join('sub2', 'ddd.in'), - os.path.join('sub2', 'ddd.in')))) + os.path.join('sub2', 'ddd.in')) + +stdout = TestSCons.re_escape(test.wrap_stdout(read_str = read_str, + build_str = build_str)) + +test.run(arguments = '.', stdout = stdout, stderr = 2*warning) test.must_match(['sub', 'SConscript'], "'sub/sc-SConscript'\n") test.must_match('all', "sub/sc-aaa.in\nsub/sc-bbb.in\nsub/sc-ccc.in\n") diff --git a/test/Deprecated/SourceCode/Subversion.py b/test/Deprecated/SourceCode/Subversion.py index 01a12f6..a97c86f 100644 --- a/test/Deprecated/SourceCode/Subversion.py +++ b/test/Deprecated/SourceCode/Subversion.py @@ -32,6 +32,16 @@ import TestSCons test = TestSCons.TestSCons() +test.write('SConscript', """ +Environment(tools = ['Subversion']).Subversion('') +""") + +msg_svn = """The Subversion() factory is deprecated and there is no replacement.""" +warn_svn = test.deprecated_fatal('deprecated-build-dir', msg_svn) +msg_sc = """SourceCode() has been deprecated and there is no replacement. +\tIf you need this function, please contact dev@scons.tigris.org.""" +warn_sc = test.deprecated_wrap(msg_sc) + svn = test.where_is('svn') if not svn: test.skip_test("Could not find 'svn'; skipping test(s).\n") @@ -73,6 +83,7 @@ test.run(chdir = 'import', # Test the most straightforward Subversion checkouts, using the module name. test.write(['work1', 'SConstruct'], """ +SetOption('warn', 'deprecated-source-code') def cat(env, source, target): target = str(target[0]) f = open(target, "wb") @@ -120,6 +131,7 @@ test.fail_test(test.read(['work1', 'foo', 'sub', 'all']) != "import/sub/ddd.in\n # Test Subversion checkouts when the module name is specified. test.write(['work2', 'SConstruct'], """ +SetOption('warn', 'deprecated-source-code') def cat(env, source, target): target = str(target[0]) f = open(target, "wb") diff --git a/test/Deprecated/TaskmasterNeedsExecute.py b/test/Deprecated/TaskmasterNeedsExecute.py index eb3de40..9f7ade1 100644 --- a/test/Deprecated/TaskmasterNeedsExecute.py +++ b/test/Deprecated/TaskmasterNeedsExecute.py @@ -33,7 +33,7 @@ import TestSCons test = TestSCons.TestSCons(match = TestSCons.match_re_dotall) -test.write('SConstruct', """ +test.write('SConscript', """ import SCons.Taskmaster tm = SCons.Taskmaster.Taskmaster() task = SCons.Taskmaster.Task(tm, [], True, None) diff --git a/test/implicit/changed-node.py b/test/implicit/changed-node.py index 6321b82..4f879c0 100644 --- a/test/implicit/changed-node.py +++ b/test/implicit/changed-node.py @@ -34,7 +34,6 @@ import TestSCons test = TestSCons.TestSCons() - test.subdir('d', ['d', '1'], ['d', '2'], @@ -43,7 +42,6 @@ test.subdir('d', test.write('SConstruct', """\ SetOption('implicit_cache', 1) SetOption('max_drift', 1) -SourceCode('.', None) def lister(target, source, env): import os @@ -78,11 +76,9 @@ test.write(['d', '3', 'z'], "d/3/z\n") test.run('--debug=stacktrace') - test.write('SConstruct', """\ SetOption('implicit_cache', 1) SetOption('max_drift', 1) -SourceCode('.', None) def lister(target, source, env): import os.path @@ -108,8 +104,6 @@ test.run('--debug=stacktrace') test.pass_test() - - #from os import system, rmdir, remove, mkdir, listdir #from os.path import exists, isdir #import sys |