diff options
author | Joseph Brill <48932340+jcbrill@users.noreply.github.com> | 2022-07-08 11:09:33 (GMT) |
---|---|---|
committer | Joseph Brill <48932340+jcbrill@users.noreply.github.com> | 2022-07-08 11:09:33 (GMT) |
commit | 3cc119751accbc87228e2725404dc5361db57209 (patch) | |
tree | afd393aa2b18bc89e9f8aa0bc3544bcf79a5cf31 | |
parent | 737abe7d169c265f53d5cf8f0629b5d66eca92d4 (diff) | |
download | SCons-3cc119751accbc87228e2725404dc5361db57209.zip SCons-3cc119751accbc87228e2725404dc5361db57209.tar.gz SCons-3cc119751accbc87228e2725404dc5361db57209.tar.bz2 |
Additional policy tests for coverage.
-rw-r--r-- | test/MSVC/MSVC_NOTFOUND_POLICY.py | 12 | ||||
-rw-r--r-- | test/MSVC/MSVC_SCRIPTERROR_POLICY.py | 13 |
2 files changed, 25 insertions, 0 deletions
diff --git a/test/MSVC/MSVC_NOTFOUND_POLICY.py b/test/MSVC/MSVC_NOTFOUND_POLICY.py index e9ed4a6..d45999a 100644 --- a/test/MSVC/MSVC_NOTFOUND_POLICY.py +++ b/test/MSVC/MSVC_NOTFOUND_POLICY.py @@ -96,6 +96,18 @@ test.run(arguments='-Q -s', status=2, stderr=None) expect = "MSVCVersionNotFound: MSVC version '12.9' was not found." test.must_contain_all(test.stderr(), expect) +# Test environment construction with global policy and construction variable ignored +test.write('SConstruct', textwrap.dedent( + """ + from SCons.Tool.MSCommon import msvc_set_notfound_policy + msvc_set_notfound_policy('Exception') + env = Environment(MSVC_VERSION='12.9', MSVC_NOTFOUND_POLICY=None, tools=['msvc']) + """ +)) +test.run(arguments='-Q -s', status=2, stderr=None) +expect = "MSVCVersionNotFound: MSVC version '12.9' was not found." +test.must_contain_all(test.stderr(), expect) + # Test environment construction with construction variable test.write('SConstruct', textwrap.dedent( """ diff --git a/test/MSVC/MSVC_SCRIPTERROR_POLICY.py b/test/MSVC/MSVC_SCRIPTERROR_POLICY.py index 977dab8..acc1a41 100644 --- a/test/MSVC/MSVC_SCRIPTERROR_POLICY.py +++ b/test/MSVC/MSVC_SCRIPTERROR_POLICY.py @@ -118,6 +118,19 @@ if default_version.msvc_vernum >= 14.1: expect = "MSVCScriptExecutionError: vc script errors detected:" test.must_contain_all(test.stderr(), expect) + # Test environment construction with global policy and construction variable ignored + test.write('SConstruct', textwrap.dedent( + """ + from SCons.Tool.MSCommon import msvc_set_scripterror_policy + DefaultEnvironment(tools=[]) + msvc_set_scripterror_policy('Exception') + env = Environment(MSVC_SCRIPT_ARGS=['-thisdoesnotexist=somevalue'], MSVC_SCRIPTERROR_POLICY=None, tools=['msvc']) + """ + )) + test.run(arguments='-Q -s', status=2, stderr=None) + expect = "MSVCScriptExecutionError: vc script errors detected:" + test.must_contain_all(test.stderr(), expect) + # Test environment construction with construction variable test.write('SConstruct', textwrap.dedent( """ |