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