diff options
-rw-r--r-- | src/plugins/scanner/cpp/cppscanner.cpp | 2 | ||||
-rw-r--r-- | tests/auto/api/testdata/rc/rc.qbs | 2 | ||||
-rw-r--r-- | tests/auto/api/testdata/rc/subdir/rc-include.h | 0 | ||||
-rw-r--r-- | tests/auto/api/testdata/rc/test.rc | 2 | ||||
-rw-r--r-- | tests/auto/api/tst_api.cpp | 30 |
5 files changed, 29 insertions, 7 deletions
diff --git a/src/plugins/scanner/cpp/cppscanner.cpp b/src/plugins/scanner/cpp/cppscanner.cpp index 1d7fb7c84..067127d00 100644 --- a/src/plugins/scanner/cpp/cppscanner.cpp +++ b/src/plugins/scanner/cpp/cppscanner.cpp @@ -311,7 +311,7 @@ static const char **additionalFileTags(void *opaq, int *size) ScannerPlugin includeScanner = { "include_scanner", - "cpp,cpp_pch_src,c,c_pch_src,objcpp,objcpp_pch_src,objc,objc_pch_src", + "cpp,cpp_pch_src,c,c_pch_src,objcpp,objcpp_pch_src,objc,objc_pch_src,rc", openScanner, closeScanner, next, diff --git a/tests/auto/api/testdata/rc/rc.qbs b/tests/auto/api/testdata/rc/rc.qbs index 5b49c5de9..212adc4af 100644 --- a/tests/auto/api/testdata/rc/rc.qbs +++ b/tests/auto/api/testdata/rc/rc.qbs @@ -5,6 +5,8 @@ Application { Depends { name: 'cpp' } + cpp.includePaths: "subdir" + files: [ "main.cpp", "test.rc" diff --git a/tests/auto/api/testdata/rc/subdir/rc-include.h b/tests/auto/api/testdata/rc/subdir/rc-include.h new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/tests/auto/api/testdata/rc/subdir/rc-include.h diff --git a/tests/auto/api/testdata/rc/test.rc b/tests/auto/api/testdata/rc/test.rc index a8e5fd39b..ff7a72003 100644 --- a/tests/auto/api/testdata/rc/test.rc +++ b/tests/auto/api/testdata/rc/test.rc @@ -1,5 +1,7 @@ #define IDR_VERSION1 1 +#include <rc-include.h> + IDR_VERSION1 VERSIONINFO FILEVERSION 1,0,0,0 PRODUCTVERSION 1,0,0,0 diff --git a/tests/auto/api/tst_api.cpp b/tests/auto/api/tst_api.cpp index bec33d1dd..228b0e078 100644 --- a/tests/auto/api/tst_api.cpp +++ b/tests/auto/api/tst_api.cpp @@ -2380,12 +2380,30 @@ void TestApi::rc() { BuildDescriptionReceiver bdr; ProcessResultReceiver prr; - const qbs::ErrorInfo errorInfo = doBuildProject("rc", &bdr, &prr); - if (errorInfo.hasError()) - qDebug() << prr.output; - VERIFY_NO_ERROR(errorInfo); - const bool rcFileWasCompiled = bdr.descriptions.contains("compiling test.rc"); - QCOMPARE(rcFileWasCompiled, qbs::Internal::HostOsInfo::isWindowsHost()); + const auto buildRc = [this, &bdr, &prr]() { + bdr.descriptions.clear(); + bdr.descriptionLines.clear(); + prr.output.clear(); + prr.results.clear(); + const qbs::ErrorInfo errorInfo = doBuildProject("rc", &bdr, &prr); + if (errorInfo.hasError()) + qDebug() << prr.output; + return errorInfo; + }; + const auto rcFileWasCompiled = [&bdr]() { + return bdr.descriptions.contains("compiling test.rc"); + }; + qbs::ErrorInfo error = buildRc(); + VERIFY_NO_ERROR(error); + QCOMPARE(rcFileWasCompiled(), qbs::Internal::HostOsInfo::isWindowsHost()); + WAIT_FOR_NEW_TIMESTAMP(); + error = buildRc(); + VERIFY_NO_ERROR(error); + QVERIFY(!rcFileWasCompiled()); + touch("subdir/rc-include.h"); + error = buildRc(); + VERIFY_NO_ERROR(error); + QCOMPARE(rcFileWasCompiled(), qbs::Internal::HostOsInfo::isWindowsHost()); } void TestApi::referencedFileErrors() |