The current lldbtest format has a number of shortcomings, all related to how we omit information based on why the test fails. For example, a successful test would print nothing, even when -a is passed to lit. It's not up to the test format to decide whether to print something or not, that's handled by lit itself. For other test results we would sometimes print stdout and stderr, but sometimes we would forget, such as when a timeout was reached or we couldn't parse the dotest output.
This patch changes the lldbtest format and makes it behave more like lit. We now always print the dotest invocation, the exit code, the output to stdout & stderr. If you're used to dealing with ShTests in lit, this will feel all very familiar.
This crashes on timeout since exitCode is not declared:
UNRESOLVED: lldb-api :: tools/lldb-vscode/variables/TestVSCode_variables.py (1906 of 1907) ******************** TEST 'lldb-api :: tools/lldb-vscode/variables/TestVSCode_variables.py' FAILED ******************** Exception during script execution: Traceback (most recent call last): File "/home/mgorny/llvm-project/llvm/utils/lit/lit/worker.py", line 91, in _execute_test_handle_errors return _adapt_result(test.config.test_format.execute(test, lit_config)) File "/home/mgorny/llvm-project/llvm/tools/lldb/test/API/lldbtest.py", line 100, in execute ' '.join(cmd), exitCode) UnboundLocalError: local variable 'exitCode' referenced before assignment