[PATCH] D16196: [test-suite] Add HOME to test env under lit

Chad Rosier via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 14 09:29:58 PST 2016


mcrosier created this revision.
mcrosier added a reviewer: MatzeB.
mcrosier added a subscriber: llvm-commits.

All,
llvm-lit blanks the environment during testing, adding back only those
variables explicitly provided during configuration (through lit.cfg or
lit.site.cfg or others).

Normally this causes no issues, but under emulation, sqlite3 will fail
verification because it attempts to find the home directory of the user
running the test. It does this by using getpwuid, which does not work
under emulation, and prints an error that breaks the diff step.

Fortunately, it uses the HOME env variable as a backup, so this patch
adds a step to lit.cfg that adds the HOME env variable to the test
environment if it exists in the host environment.

 Chad

http://reviews.llvm.org/D16196

Files:
  lit.cfg

Index: lit.cfg
===================================================================
--- lit.cfg
+++ lit.cfg
@@ -236,3 +236,5 @@
 config.traditional_output = True
 if 'SSH_AUTH_SOCK' in os.environ:
     config.environment['SSH_AUTH_SOCK'] = os.environ['SSH_AUTH_SOCK']
+if 'HOME' in os.environ:
+    config.environment['HOME'] = os.environ['HOME']


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D16196.44896.patch
Type: text/x-patch
Size: 346 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160114/9a4f1ca7/attachment.bin>


More information about the llvm-commits mailing list