Now search for tests folder bottom-up.

This commit is contained in:
NissimHadar 2018-03-07 11:30:30 -08:00
parent 2f040d0032
commit 9bd7f31ff3

View file

@ -476,13 +476,14 @@ QString Test::getExpectedImagePartialSourceDirectory(QString filename) {
QString filenameWithoutExtension = filename.split(".")[0]; QString filenameWithoutExtension = filename.split(".")[0];
QStringList filenameParts = filenameWithoutExtension.split("_"); QStringList filenameParts = filenameWithoutExtension.split("_");
// Note that the topmost "tests" folder is assumed to be the root // Note that the bottom-most "tests" folder is assumed to be the root
int i { 0 }; // This is required because the tests folder is named hifi_tests
while (i < filenameParts.length() && filenameParts[i] != "tests") { int i { filenameParts.length() - 1 };
++i; while (i >= 0 && filenameParts[i] != "tests") {
--i;
} }
if (i == filenameParts.length()) { if (i < 0) {
messageBox.critical(0, "Internal error #9", "Bad filename"); messageBox.critical(0, "Internal error #9", "Bad filename");
exit(-1); exit(-1);
} }