[PATCH] Remove environment variables from driver tests

Justin Bogner mail at justinbogner.com
Wed Jun 24 12:11:38 PDT 2015


Steven Wu <stevenwu at apple.com> writes:
> After some thoughts, I think the first patch works better to serve the
> purpose. Environmental variable SDKROOT can be important for other
> clang tests but dangerous to Driver test. It can pollute all the
> driver tests doesn't specify a default sysroot and causing target
> triple to mismatch.
> My goal is to recommit r226005 which is reverted because Darwin bots
> has SDKROOT environment set.
>
>
> REPOSITORY
>   rL LLVM
>
> http://reviews.llvm.org/D7135
>
> Files:
>   test/Driver/lit.local.cfg
>
> Index: test/Driver/lit.local.cfg
> ===================================================================
> --- test/Driver/lit.local.cfg
> +++ test/Driver/lit.local.cfg
> @@ -4,3 +4,13 @@
>  config.substitutions.insert(0,
>      ('%clang_cc1',
>       """*** Do not use 'clang -cc1' in Driver tests. ***""") )
> +
> +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]

Needs a comment explaining why we're doing this, but otherwise LGTM.



More information about the cfe-commits mailing list