[PATCH] D35396: [lit] Make %T return a per-test temporary directory

Kuba (Brecka) Mracek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 13 17:18:07 PDT 2017


kubamracek created this revision.
Herald added a reviewer: modocache.

I've recently found a weird non-deterministic failure in the case-insensitive-include-ms.c, case-insensitive-include.c and case-insensitive-system-include.c testcases.  The reason was that they actually share the same %T directory and when they're run in parallel, they can overwrite other test's data.  Pretty terrible, right?

This patch changes lit so it generates a per-test temporary directory for %T and not a per-test-suite temporary dir.  Another option would of course be to fix the above-mentioned tests, but do we really need to require test writers to remember that %T is not unique to the test?


Repository:
  rL LLVM

https://reviews.llvm.org/D35396

Files:
  utils/lit/lit/TestRunner.py


Index: utils/lit/lit/TestRunner.py
===================================================================
--- utils/lit/lit/TestRunner.py
+++ utils/lit/lit/TestRunner.py
@@ -695,7 +695,7 @@
     root, not test source root."""
     execpath = test.getExecPath()
     execdir,execbase = os.path.split(execpath)
-    tmpDir = os.path.join(execdir, 'Output')
+    tmpDir = os.path.join(execdir, 'Output', execbase + ".tmpdir")
     tmpBase = os.path.join(tmpDir, execbase)
     return tmpDir, tmpBase
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D35396.106560.patch
Type: text/x-patch
Size: 496 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170714/e925d082/attachment.bin>


More information about the llvm-commits mailing list