From dfbb5c1b76b8cf1366bc795925c783805126cc29 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Wed, 22 Oct 2014 00:34:31 +0000 Subject: [PATCH] Fix ShTest parsing error when a keyword line doesn't end with a newline. llvm-svn: 220354 --- llvm/utils/lit/lit/TestRunner.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/llvm/utils/lit/lit/TestRunner.py b/llvm/utils/lit/lit/TestRunner.py index ca87b05..f280d3f 100644 --- a/llvm/utils/lit/lit/TestRunner.py +++ b/llvm/utils/lit/lit/TestRunner.py @@ -343,6 +343,10 @@ def parseIntegratedTestScriptCommands(source_path): # Read the entire file contents. data = f.read() + # Ensure the data ends with a newline. + if not data.endswith('\n'): + data = data + '\n' + # Iterate over the matches. line_number = 1 last_match_position = 0 -- 2.7.4