[XRay] Fix fdr-thread-order.cc when current directory contains fdr-thread-order.cc
authorFangrui Song <maskray@google.com>
Fri, 28 Sep 2018 04:20:08 +0000 (04:20 +0000)
committerFangrui Song <maskray@google.com>
Fri, 28 Sep 2018 04:20:08 +0000 (04:20 +0000)
commit13a6750c2e76991723c8aa9c48c37fb0a7e3a8d0
tree04175cc5fa88e6615ed40a444e489440f459348e
parentbb50c38635684a95979437c6ea511253ea843c1a
[XRay] Fix fdr-thread-order.cc when current directory contains fdr-thread-order.cc

Summary:
Currently,

    cd test/xray/TestCases/Posix
    $build/bin/llvm-lit fdr-thread-order.cc

fails because `rm fdr-thread-order.*` deletes the .cc file.

This patch uses:

* %t as temporary directory name containing log files
* %t.exe as executable name

It does not delete %t after the test finishes for debugging convenience.
This matches the behavior of tests of various other LLVM components.

Log files will not clog up because the temporary directory (unique among
test files but the same among multiple invocations of a test) is cleaned
at the beginning of the test.

Reviewers: dberris, mboerger, eizan

Reviewed By: dberris

Subscribers: delcypher, llvm-commits, #sanitizers

Differential Revision: https://reviews.llvm.org/D52638

llvm-svn: 343295
compiler-rt/test/xray/TestCases/Posix/fdr-thread-order.cc