diff options
author | Steven Knight <knight@baldmt.com> | 2004-04-06 16:17:34 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2004-04-06 16:17:34 (GMT) |
commit | ce5403ae95d90fa06a507b1878206a312b125edb (patch) | |
tree | 519c1dc00835c3eef340400099da50c0328b76ff /test/overrides.py | |
parent | e69debfd6d48ed158699ba814c1c23459e121a20 (diff) | |
download | SCons-ce5403ae95d90fa06a507b1878206a312b125edb.zip SCons-ce5403ae95d90fa06a507b1878206a312b125edb.tar.gz SCons-ce5403ae95d90fa06a507b1878206a312b125edb.tar.bz2 |
Add warnings for easily-confused variable names like 'targets' and 'sources.'
Diffstat (limited to 'test/overrides.py')
-rw-r--r-- | test/overrides.py | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/test/overrides.py b/test/overrides.py index a247f7d..eb43ced 100644 --- a/test/overrides.py +++ b/test/overrides.py @@ -92,4 +92,41 @@ assert test.read('hello.not_exe') == 'this is not a program!' test.up_to_date(arguments='hello.not_exe') + + +test.write('SConstruct', """\ +env = Environment() +env.Program('goodbye', 'goodbye.c', + CC=r'%s mycc.py', + LINK=r'%s mylink.py', + OBJSUFFIX='.not_obj', + PROGSUFFIX='.not_exe', + targets='ttt', + sources='sss') +""" % (python, python)) + +test.write('goodbye.c',"this ain't no c file!\n") + +test.write('mycc.py',""" +open('goodbye.not_obj', 'wt').write('this is no object file!') +""") + +test.write('mylink.py',""" +open('goodbye.not_exe', 'wt').write('this is not a program!') +""") + +test.run(arguments='goodbye.not_exe', stderr="""\ + +scons: warning: Did you mean to use `target' instead of `targets'? +File "SConstruct", line 8, in ? + +scons: warning: Did you mean to use `source' instead of `sources'? +File "SConstruct", line 8, in ? +""") + +assert test.read('goodbye.not_obj') == 'this is no object file!' +assert test.read('goodbye.not_exe') == 'this is not a program!' + + + test.pass_test() |