Skip to content

Commit

Permalink
Test utils: further clean up our test output (#2178).
Browse files Browse the repository at this point in the history
  • Loading branch information
agarny committed Dec 9, 2019
1 parent 921fb66 commit 2d493fb
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/tests/src/testsutils.cpp
Expand Up @@ -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');

Expand Down

0 comments on commit 2d493fb

Please sign in to comment.