From 2d493fb8e8e93793e8733ce4197ec0ee09720a64 Mon Sep 17 00:00:00 2001 From: Alan Garny Date: Tue, 10 Dec 2019 12:53:39 +1300 Subject: [PATCH] Test utils: further clean up our test output (#2178). --- src/tests/src/testsutils.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/tests/src/testsutils.cpp b/src/tests/src/testsutils.cpp index b9186e025e..197b86b18c 100644 --- a/src/tests/src/testsutils.cpp +++ b/src/tests/src/testsutils.cpp @@ -157,12 +157,17 @@ int runCli(const QStringList &pArguments, QStringList &pOutput) } // Clean up our output by: - // - Making any path relative rather than absolute; + // - Replacing escaped backslashes with a non-escaped one; + // - Making paths relative rather than absolute; // - Replacing backslashes with forward slashes; and // - Removing all occurrences of the CR character. + // Note: the idea is to be able to compare our output indepedent of where + // the test was run from and of which operating system it was run + // on... - pOutput = output.remove(dirName()) - .replace("\\\\", "/") + pOutput = output.replace("\\\\", "\\") + .remove(dirName()) + .replace("\\", "/") .remove('\r') .split('\n');