[lit] GoogleTest framework should report failures if test binary crashes
authorStephen Neuendorffer <stephen.neuendorffer@xilinx.com>
Mon, 18 May 2020 00:41:39 +0000 (17:41 -0700)
committerStephen Neuendorffer <stephen.neuendorffer@xilinx.com>
Wed, 20 May 2020 20:36:08 +0000 (13:36 -0700)
commitef2103182244c96f5206b02164b62b9c9e0cbce8
tree8ce3cb2874fa8f501e0bd8251bd44f0dce926f2c
parent6ef45b0426a8c7b9764e102fb1a49561a3a2c118
[lit] GoogleTest framework should report failures if test binary crashes

lit runs a gtest executable multiple times. First it runs it to
discover tests, then later it runs the executable again for each test.
However, if the discovery fails (perhaps because of a broken
executable), then no tests were previously run and no failures were
reported.  This patch creates a dummy test if discovery fails, which
will later fail when test are run and be reported as a failure.

Differential Revision: https://reviews.llvm.org/D80096
llvm/utils/lit/lit/formats/googletest.py
llvm/utils/lit/tests/Inputs/googletest-discovery-failed/lit.cfg [new file with mode: 0644]
llvm/utils/lit/tests/Inputs/googletest-discovery-failed/subdir/OneTest.py [new file with mode: 0644]
llvm/utils/lit/tests/googletest-discovery-failed.py [new file with mode: 0644]