summaryrefslogtreecommitdiffstats
path: root/test/Deprecated/SourceCode/RCS/changed.py
diff options
context:
space:
mode:
authorGreg Noel <GregNoel@tigris.org>2010-05-28 09:40:40 (GMT)
committerGreg Noel <GregNoel@tigris.org>2010-05-28 09:40:40 (GMT)
commit56309561f2396659965eda63b30c69043e17d3f6 (patch)
tree2a9eaf225729bc320b75e8f0f5f70872b3a72c8f /test/Deprecated/SourceCode/RCS/changed.py
parent1611fe9bdefe760e4fbfd0a4ae85892a3094e19e (diff)
downloadSCons-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/Deprecated/SourceCode/RCS/changed.py')
-rw-r--r--test/Deprecated/SourceCode/RCS/changed.py24
1 files changed, 15 insertions, 9 deletions
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: