while len(stdouta) > 0 and stdouta[-1] == "":
del stdouta[-1]
stdouta = self.remove_ignored_lines(stdouta)
+ stdcpy = stdouta[:]
- #the "sort" bash command is case unsensitive,
- # we mimic its behaviour
+ # Mimic the "sort" bash command, which is case unsensitive.
if self.sort == 0:
stdouta.sort(key=lambda x: x.lower())
self.output_pipe_stdout.sort(key=lambda x: x.lower())
diff = list(difflib.unified_diff(self.output_pipe_stdout, stdouta,lineterm="",fromfile='expected', tofile='obtained'))
if len(diff) > 0:
print("Output of <"+cmdName+"> mismatch:")
- for line in diff:
- print(line)
+ if self.sort >= 0: # If sorted, truncate the diff output and show the unsorted version
+ difflen = 0;
+ for line in diff:
+ if difflen<250:
+ print(line)
+ difflen += 1
+ if difflen > 100:
+ print("(diff truncated after 250 lines)")
+ print("Unsorted observed output:\n")
+ for line in stdcpy:
+ print(line)
+ else: # If not sorted, just display the diff
+ for line in diff:
+ print(line)
+
print("Test suite `"+FileReader().filename+"': NOK (<"+cmdName+"> output mismatch)")
if lock is not None: lock.release()
if TeshState().keep:
TeshState().ignore_regexps_common = [
re.compile("^profiling:"),
re.compile(".*WARNING: ASan doesn\'t fully support"),
- re.compile("Unable to clean temporary file C:.*")]
+ re.compile("Unable to clean temporary file C:.*"),
+ re.compile(".*Configuration change: Set \'contexts/")]
if options.teshfile is None:
f = FileReader(None)