[lit] Fix handling of various keyword parse errors
authorJoel E. Denny <jdenny.ornl@gmail.com>
Fri, 12 Jun 2020 13:27:03 +0000 (09:27 -0400)
committerJoel E. Denny <jdenny.ornl@gmail.com>
Fri, 12 Jun 2020 13:37:40 +0000 (09:37 -0400)
commit2866f9db9e5e9d2e6c14ae179c49c2f1a35bca90
tree2de32b6042544c73b3980440840cd6eef9428454
parent8af7fa07aa24656465cb76d2e300eb3162cd0ba2
[lit] Fix handling of various keyword parse errors

In TestRunner.py, D78589 extracts a `_parseKeywords` function from
`parseIntegratedTestScript`, which then expects `_parseKeywords` to
always return a list of keyword/value pairs.  However, the extracted
code sometimes returns an unresolved `lit.Test.Result` on a keyword
parsing error, which then produces a stack dump instead of the
expected diagnostic.

This patch fixes that, makes the style of those diagnostics more
consistent, and extends the lit test suite to cover them.

Reviewed By: ldionne

Differential Revision: https://reviews.llvm.org/D81665
llvm/utils/lit/lit/TestRunner.py
llvm/utils/lit/tests/Inputs/shtest-keyword-parse-errors/empty.txt [new file with mode: 0644]
llvm/utils/lit/tests/Inputs/shtest-keyword-parse-errors/lit.cfg [new file with mode: 0644]
llvm/utils/lit/tests/Inputs/shtest-keyword-parse-errors/multiple-allow-retries.txt [new file with mode: 0644]
llvm/utils/lit/tests/Inputs/shtest-keyword-parse-errors/unterminated-run.txt [new file with mode: 0644]
llvm/utils/lit/tests/shtest-keyword-parse-errors.py [new file with mode: 0644]
llvm/utils/lit/tests/unit/TestRunner.py