config.suffixes = ['.c', '.cpp', '.h', '.m', '.mm', '.S', '.s', '.f90', '.f95',
                   '.cu']
config.substitutions = list(config.substitutions)
config.substitutions.insert(0,
    ('%clang_cc1',
     """*** Do not use 'clang -cc1' in Driver tests. ***""") )

config.suffixes = ['.c', '.cpp', '.h', '.m', '.mm', '.S', '.s', '.f90', '.f95',
                   '.cu']
config.substitutions = list(config.substitutions)
config.substitutions.insert(0,
    ('%clang_cc1',
     """*** Do not use 'clang -cc1' in Driver tests. ***""") )

# Remove harmful environmental variables for clang Driver tests.
# Some might be useful for other tests so they are only removed here.
driver_overwrite_env_vars = ['MACOSX_DEPLOYMENT_TARGET',
                             'IPHONEOS_DEPLOYMENT_TARGET',
                             'SDKROOT', 'CCC_OVERRIDE_OPTIONS',
                             'CC_PRINT_OPTIONS', 'CC_PRINT_HEADERS',
                             'CC_LOG_DIAGNOSTICS']

for name in driver_overwrite_env_vars:
  if name in config.environment:
    del config.environment[name]

Remove environment variables from driver tests
Remove environment variables from driver tests

Summary:
Remove some of dangerous environmental variables from clang/Driver tests.
Driver tests should not rely on preset value of these variables and may
actually fail because of them.
They cannot be removed in test/lit.cfg because we still need to support
relocatable SDKs and other overwrite for other clang tests.

Reviewers: bogner

Subscribers: rnk, cfe-commits

Differential Revision: http://reviews.llvm.org/D7135

git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@240574 91177308-0d34-0410-b5e6-96231b3b80d8
