diff options
author | Keith Isdale <keith.isdale@nokia.com> | 2009-08-28 12:58:18 +1000 |
---|---|---|
committer | Keith Isdale <keith.isdale@nokia.com> | 2009-08-28 12:58:18 +1000 |
commit | 008d0c69c16b80af6c8c59b8c3a9b6de0238f6d4 (patch) | |
tree | b02dde12fea3d5d09bbdde00b716077d2edcb0d6 /tests/auto/qmake/tst_qmake.cpp | |
parent | e9274b6cb9bbc71cf9aa7614190e0d3a242fef29 (diff) | |
download | qt4-tools-008d0c69c16b80af6c8c59b8c3a9b6de0238f6d4.tar.gz |
Add an autotest for qmake's include function
qmake's include function has been changed in 4.6.x and later to warn,by default, if the specified
file does not exist. It is possible to ignore missing .pri files, eg
include(SomeOptionalFile.pri, "", true);
Reviewed-by: Rohan McGovern
Diffstat (limited to 'tests/auto/qmake/tst_qmake.cpp')
-rw-r--r-- | tests/auto/qmake/tst_qmake.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/auto/qmake/tst_qmake.cpp b/tests/auto/qmake/tst_qmake.cpp index 168fcfd303..50ea5b95ff 100644 --- a/tests/auto/qmake/tst_qmake.cpp +++ b/tests/auto/qmake/tst_qmake.cpp @@ -88,6 +88,7 @@ private slots: // Test requires make void bundle_spaces(); #endif + void includefunction(); private: TestCompiler test_compiler; @@ -125,10 +126,12 @@ void tst_qmake::cleanupTestCase() void tst_qmake::init() { + test_compiler.clearCommandOutput(); } void tst_qmake::cleanup() { + test_compiler.clearCommandOutput(); } void tst_qmake::simple_app() @@ -438,6 +441,26 @@ void tst_qmake::bundle_spaces() } #endif // Q_OS_WIN +void tst_qmake::includefunction() +{ + QString workDir = base_path + "/testdata/include_function"; + QString warningMsg("Unable to find file for inclusion"); + QVERIFY(test_compiler.qmake( workDir, "include_existing_file")); + QVERIFY(!test_compiler.commandOutput().contains(warningMsg)); + + // test include() usage on a missing file + test_compiler.clearCommandOutput(); + workDir = base_path + "/testdata/include_function"; + QVERIFY(test_compiler.qmake( workDir, "include_missing_file" )); + QVERIFY(test_compiler.commandOutput().contains(warningMsg)); + + // test include() usage on a missing file when all function parameters are used + test_compiler.clearCommandOutput(); + workDir = base_path + "/testdata/include_function"; + QVERIFY(test_compiler.qmake( workDir, "include_missing_file2" )); + QVERIFY(test_compiler.commandOutput().contains(warningMsg)); +} + QTEST_MAIN(tst_qmake) #include "tst_qmake.moc" |