From: Daniel Dunbar Date: Wed, 22 Oct 2014 00:34:31 +0000 (+0000) Subject: Fix ShTest parsing error when a keyword line doesn't end with a newline. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=ac1af12c28c3eaf6869ec15b68697c8fc7a8efa0;p=oota-llvm.git Fix ShTest parsing error when a keyword line doesn't end with a newline. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220354 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/utils/lit/lit/TestRunner.py b/utils/lit/lit/TestRunner.py index ca87b054fa8..f280d3fd1db 100644 --- a/utils/lit/lit/TestRunner.py +++ b/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