diff --git a/src/tests/src/testsutils.cpp b/src/tests/src/testsutils.cpp index 751c3b6e65..b9186e025e 100644 --- a/src/tests/src/testsutils.cpp +++ b/src/tests/src/testsutils.cpp @@ -156,12 +156,6 @@ int runCli(const QStringList &pArguments, QStringList &pOutput) output += process.readAll(); } - // Go back to our original directory - -#ifdef Q_OS_WIN - QDir::setCurrent(origPath); -#endif - // Clean up our output by: // - Making any path relative rather than absolute; // - Replacing backslashes with forward slashes; and @@ -172,6 +166,12 @@ int runCli(const QStringList &pArguments, QStringList &pOutput) .remove('\r') .split('\n'); + // Go back to our original directory + +#ifdef Q_OS_WIN + QDir::setCurrent(origPath); +#endif + return process.exitCode(); }