]> granicus.if.org Git - clang/commitdiff
Remove environment variables from driver tests
authorSteven Wu <stevenwu@apple.com>
Wed, 24 Jun 2015 19:30:36 +0000 (19:30 +0000)
committerSteven Wu <stevenwu@apple.com>
Wed, 24 Jun 2015 19:30:36 +0000 (19:30 +0000)
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: https://llvm.org/svn/llvm-project/cfe/trunk@240574 91177308-0d34-0410-b5e6-96231b3b80d8

test/Driver/lit.local.cfg

index af6d02139069833502c2ed7b3de6236872e37a44..6c2373bd21789e78a5256b77b19cd6b4fd66dda2 100644 (file)
@@ -4,3 +4,15 @@ 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]