From af1df624e4af2b4d0231e1d8c530b9943adaff81 Mon Sep 17 00:00:00 2001 From: Michal Gorny Date: Mon, 31 Dec 2018 13:48:12 +0000 Subject: [PATCH] [test] Fix propagating HOME envvar to unittests Propagate HOME environment variable to unittests. This is necessary to fix test failures resulting from pw_home pointing to a non-existing directory while being overriden with HOME. Apparently Gentoo users hit this sometimes when they override build directory for Portage. Original bug report: https://bugs.gentoo.org/674088 Differential Revision: https://reviews.llvm.org/D56162 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350175 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/Unit/lit.cfg.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/Unit/lit.cfg.py b/test/Unit/lit.cfg.py index 609408d1dd8..3198ab2c953 100644 --- a/test/Unit/lit.cfg.py +++ b/test/Unit/lit.cfg.py @@ -31,6 +31,11 @@ if 'TMP' in os.environ: if 'TEMP' in os.environ: config.environment['TEMP'] = os.environ['TEMP'] +# Propagate HOME as it can be used to override incorrect homedir in passwd +# that causes the tests to fail. +if 'HOME' in os.environ: + config.environment['HOME'] = os.environ['HOME'] + # Propagate path to symbolizer for ASan/MSan. for symbolizer in ['ASAN_SYMBOLIZER_PATH', 'MSAN_SYMBOLIZER_PATH']: if symbolizer in os.environ: -- 2.50.1