aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2018-11-22 14:19:23 +0100
committerChristian Kandeler <christian.kandeler@qt.io>2018-11-22 14:23:30 +0000
commitb3fb2a7e579ded669a3e135144c6821e6bf73ffe (patch)
treefcb1a0f1f0cd6f481ceb030a35ddbefa31b03c78
parentf9b2db9ac2a2fbb6395993010beef75c22a0a22e (diff)
Fix protobuf autotests
Product-level probes run before module validate scripts, so we cannot use a Probe to determine whether the protobuf module was successfully set up. Change-Id: I6debc86f1b6b06c8bbdb276a7ff786828b9f9819 Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
-rw-r--r--tests/auto/blackbox/testdata/protobuf/addressbook_cpp.qbs13
-rw-r--r--tests/auto/blackbox/testdata/protobuf/addressbook_objc.qbs13
-rw-r--r--tests/auto/blackbox/testdata/protobuf/import.qbs11
-rw-r--r--tests/auto/blackbox/testdata/protobuf/needs-import-dir.qbs11
4 files changed, 18 insertions, 30 deletions
diff --git a/tests/auto/blackbox/testdata/protobuf/addressbook_cpp.qbs b/tests/auto/blackbox/testdata/protobuf/addressbook_cpp.qbs
index 797d4174e..a5a4caf75 100644
--- a/tests/auto/blackbox/testdata/protobuf/addressbook_cpp.qbs
+++ b/tests/auto/blackbox/testdata/protobuf/addressbook_cpp.qbs
@@ -3,18 +3,15 @@ import qbs
CppApplication {
name: "addressbook_cpp"
consoleApplication: true
- condition: protobuf.present
+ condition: hasProtobuf
Depends { name: "cpp" }
cpp.cxxLanguageVersion: "c++11"
- Depends { id: protobuf; name: "protobuf.cpp"; required: false }
- Probe {
- id: presentProbe
- property bool hasModule: protobuf.present
- configure: {
- console.info("has protobuf: " + hasModule);
- }
+ Depends { name: "protobuf.cpp"; required: false }
+ property bool hasProtobuf: {
+ console.info("has protobuf: " + protobuf.cpp.present);
+ return protobuf.cpp.present;
}
files: [
diff --git a/tests/auto/blackbox/testdata/protobuf/addressbook_objc.qbs b/tests/auto/blackbox/testdata/protobuf/addressbook_objc.qbs
index 9ee82c68f..be68abfee 100644
--- a/tests/auto/blackbox/testdata/protobuf/addressbook_objc.qbs
+++ b/tests/auto/blackbox/testdata/protobuf/addressbook_objc.qbs
@@ -3,16 +3,13 @@ import qbs
CppApplication {
name: "addressbook_objc"
consoleApplication: true
- condition: protobuf.present && qbs.targetOS.contains("darwin")
+ condition: hasProtobuf
Depends { name: "cpp" }
- Depends { id: protobuf; name: "protobuf.objc"; required: false }
- Probe {
- id: presentProbe
- property bool hasModule: protobuf.present && qbs.targetOS.contains("darwin")
- configure: {
- console.info("has protobuf: " + hasModule);
- }
+ Depends { name: "protobuf.objc"; required: false }
+ property bool hasProtobuf: {
+ console.info("has protobuf: " + protobuf.objc.present);
+ return protobuf.objc.present;
}
files: [
diff --git a/tests/auto/blackbox/testdata/protobuf/import.qbs b/tests/auto/blackbox/testdata/protobuf/import.qbs
index b93e03a1e..4c4de063f 100644
--- a/tests/auto/blackbox/testdata/protobuf/import.qbs
+++ b/tests/auto/blackbox/testdata/protobuf/import.qbs
@@ -3,19 +3,16 @@ import qbs
CppApplication {
name: "app"
consoleApplication: true
- condition: protobuf.cpp.present
+ condition: hasProtobuf
protobuf.cpp.importPaths: [sourceDirectory]
cpp.cxxLanguageVersion: "c++11"
Depends { name: "protobuf.cpp"; required: false }
- Probe {
- id: presentProbe
- property bool hasModule: protobuf.cpp.present
- configure: {
- console.info("has protobuf: " + hasModule);
- }
+ property bool hasProtobuf: {
+ console.info("has protobuf: " + protobuf.cpp.present);
+ return protobuf.cpp.present;
}
files: [
diff --git a/tests/auto/blackbox/testdata/protobuf/needs-import-dir.qbs b/tests/auto/blackbox/testdata/protobuf/needs-import-dir.qbs
index e95421a9e..788bbc93c 100644
--- a/tests/auto/blackbox/testdata/protobuf/needs-import-dir.qbs
+++ b/tests/auto/blackbox/testdata/protobuf/needs-import-dir.qbs
@@ -3,7 +3,7 @@ import qbs
CppApplication {
name: "app"
consoleApplication: true
- condition: protobuf.cpp.present
+ condition: hasProtobuf
property path theImportDir
protobuf.cpp.importPaths: (theImportDir ? [theImportDir] : []).concat([sourceDirectory])
@@ -11,12 +11,9 @@ CppApplication {
cpp.cxxLanguageVersion: "c++11"
Depends { name: "protobuf.cpp"; required: false }
- Probe {
- id: presentProbe
- property bool hasModule: protobuf.cpp.present
- configure: {
- console.info("has protobuf: " + hasModule);
- }
+ property bool hasProtobuf: {
+ console.info("has protobuf: " + protobuf.cpp.present);
+ return protobuf.cpp.present;
}
files: [