summaryrefslogtreecommitdiffstats
path: root/test/Deprecated/SourceCode/SCCS
diff options
context:
space:
mode:
Diffstat (limited to 'test/Deprecated/SourceCode/SCCS')
-rw-r--r--test/Deprecated/SourceCode/SCCS/SCCSCOM.py32
-rw-r--r--test/Deprecated/SourceCode/SCCS/SCCSCOMSTR.py34
-rw-r--r--test/Deprecated/SourceCode/SCCS/diskcheck.py20
-rw-r--r--test/Deprecated/SourceCode/SCCS/explicit.py11
-rw-r--r--test/Deprecated/SourceCode/SCCS/implicit.py10
-rw-r--r--test/Deprecated/SourceCode/SCCS/transparent.py10
6 files changed, 84 insertions, 33 deletions
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: