diff options
author | Jan Arve Sæther <jan-arve.saether@qt.io> | 2019-08-22 10:18:53 +0200 |
---|---|---|
committer | Jan Arve Sæther <jan-arve.saether@qt.io> | 2019-08-22 11:21:38 +0200 |
commit | 529b27152068f02fc67dba6e4bb88be918220827 (patch) | |
tree | 55f08d6a61ab004cf31699565082e63e5130638e /src/tools | |
parent | 4300dccba56ed1904c3481a4b19fdc5475f6b3e1 (diff) | |
download | qtbase-529b27152068f02fc67dba6e4bb88be918220827.tar.gz |
Don't excessively check all output files for failures
This is really just an optimization, but I suspect the author of the code
assumed that the bitwise &= operator short-cicuits. (It doesn't). So this
patch should then fix the code to have the intended behavior.
We don't have to check for failures in the remaining output files once
we've found one. pullFiles() returns just a bool indicating if one of the
output files has a recorded fail, so checking the remaining output files
after the first found failure is just a waste (and ideally they should
contain the same failure (however, flaky tests might break this ideal)).
Drive-by fix.
Change-Id: I951e500a69198e7ed124be32199ac81bbddb9bf7
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Diffstat (limited to 'src/tools')
-rw-r--r-- | src/tools/androidtestrunner/main.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tools/androidtestrunner/main.cpp b/src/tools/androidtestrunner/main.cpp index a035e068bc..f61d407d4a 100644 --- a/src/tools/androidtestrunner/main.cpp +++ b/src/tools/androidtestrunner/main.cpp @@ -409,7 +409,7 @@ static bool pullFiles() return false; } auto checkerIt = g_options.checkFiles.find(it.key()); - ret &= checkerIt != g_options.checkFiles.end() && checkerIt.value()(output); + ret = ret && checkerIt != g_options.checkFiles.end() && checkerIt.value()(output); if (it.value() == QStringLiteral("-")){ fprintf(stdout, "%s", output.constData()); fflush(stdout); |