]> granicus.if.org Git - llvm/commitdiff
[test] Fix propagating HOME envvar to unittests
authorMichal Gorny <mgorny@gentoo.org>
Mon, 31 Dec 2018 13:48:12 +0000 (13:48 +0000)
committerMichal Gorny <mgorny@gentoo.org>
Mon, 31 Dec 2018 13:48:12 +0000 (13:48 +0000)
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

index 609408d1dd807ade01a8f162d6d63bd2242de56f..3198ab2c9539b5c696404bc7d73b2b72e8355176 100644 (file)
@@ -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: