From 1e6e9d1a37424cd3cfb9131fbeb2c26c30b981d9 Mon Sep 17 00:00:00 2001 From: Steven Wu Date: Wed, 24 Jun 2015 19:30:36 +0000 Subject: [PATCH] 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: https://llvm.org/svn/llvm-project/cfe/trunk@240574 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/Driver/lit.local.cfg | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/Driver/lit.local.cfg b/test/Driver/lit.local.cfg index af6d021390..6c2373bd21 100644 --- a/test/Driver/lit.local.cfg +++ b/test/Driver/lit.local.cfg @@ -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] -- 2.40.0