summaryrefslogtreecommitdiffstats
path: root/test/Deprecated/SourceCode/SourceCode.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/SourceCode.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/SourceCode.py')
-rw-r--r--test/Deprecated/SourceCode/SourceCode.py27
1 files changed, 20 insertions, 7 deletions
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")