From b4c0d9166e7a8f5dfa5ca052002a5ab318787aa2 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 24 Jul 2013 19:49:38 +0200 Subject: [PATCH] change reporting of missing files use the new parser flags to report all i/o errors directly. as a notable side effect, the "WARNING" prefix is gone (even though it is still treated like that, which is mildly insane to start with). Change-Id: I084375d5e7a3314ae763795f7c318804a9fb84b6 Reviewed-by: Joerg Bornemann --- qmake/library/qmakeevaluator.cpp | 7 ++++--- tests/auto/tools/qmake/tst_qmake.cpp | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/qmake/library/qmakeevaluator.cpp b/qmake/library/qmakeevaluator.cpp index 386bd6cc402..3f6f0487302 100644 --- a/qmake/library/qmakeevaluator.cpp +++ b/qmake/library/qmakeevaluator.cpp @@ -1819,7 +1819,10 @@ ProString QMakeEvaluator::first(const ProKey &variableName) const QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateFile( const QString &fileName, QMakeHandler::EvalFileType type, LoadFlags flags) { - if (ProFile *pro = m_parser->parsedProFile(fileName, QMakeParser::ParseUseCache)) { + QMakeParser::ParseFlags pflags = QMakeParser::ParseUseCache; + if (!(flags & LoadSilent)) + pflags |= QMakeParser::ParseReportMissing; + if (ProFile *pro = m_parser->parsedProFile(fileName, pflags)) { m_locationStack.push(m_current); VisitReturn ok = visitProFile(pro, type, flags); m_current = m_locationStack.pop(); @@ -1834,8 +1837,6 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateFile( #endif return ok; } else { - if (!(flags & LoadSilent) && !m_vfs->exists(fileName)) - evalError(fL1S("WARNING: Include file %1 not found").arg(fileName)); return ReturnFalse; } } diff --git a/tests/auto/tools/qmake/tst_qmake.cpp b/tests/auto/tools/qmake/tst_qmake.cpp index 4d3b5983f08..cf5c75a66b3 100644 --- a/tests/auto/tools/qmake/tst_qmake.cpp +++ b/tests/auto/tools/qmake/tst_qmake.cpp @@ -494,7 +494,7 @@ void tst_qmake::bundle_spaces() void tst_qmake::includefunction() { QString workDir = base_path + "/testdata/include_function"; - QRegExp warningMsg("Include file .* not found"); + QRegExp warningMsg("Cannot read .*: No such file or directory"); QVERIFY(test_compiler.qmake( workDir, "include_existing_file")); QVERIFY(!test_compiler.commandOutput().contains(warningMsg));