[lit] Keep stdout/stderr when using GoogleTest format
authorYuanfang Chen <yuanfang.chen@sony.com>
Sun, 24 Apr 2022 02:30:00 +0000 (19:30 -0700)
committerYuanfang Chen <yuanfang.chen@sony.com>
Mon, 25 Apr 2022 19:26:03 +0000 (12:26 -0700)
commitd3efa577f549760a42ba68bda95d1e576c2adda1
treef3e2899213cbbf1008ceb54449b4a8a002931388
parent88b9e46fb54c5321742d16016be5b2920facc018
[lit] Keep stdout/stderr when using GoogleTest format

When a unit test crashes or timeout, print the shard's stdout and
stderr. When a unit test fails, attaches the test's output to the LIT
output to help debugging.

While at it, concatenating shard's environment variables using space
instead of newline to make the reproducer script user friendly.

Based on D123797. (Thanks to @lenary)
llvm/utils/lit/lit/formats/googletest.py
llvm/utils/lit/lit/util.py
llvm/utils/lit/tests/Inputs/googletest-crash/DummySubDir/OneTest.py
llvm/utils/lit/tests/Inputs/googletest-format/DummySubDir/OneTest.py
llvm/utils/lit/tests/Inputs/googletest-timeout/DummySubDir/OneTest.py
llvm/utils/lit/tests/googletest-crash.py
llvm/utils/lit/tests/googletest-format.py
llvm/utils/lit/tests/googletest-timeout.py