aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/blackbox/testdata
diff options
context:
space:
mode:
authorIvan Komissarov <ABBAPOH@gmail.com>2019-05-16 23:44:02 +0200
committerIvan Komissarov <ABBAPOH@gmail.com>2019-06-27 10:18:09 +0000
commit0e5050b7f75c90d406c5292ddf8d43b6a5b555c8 (patch)
treeef6fa7afb3c6293ccf2919d0653d407df3afe3dd /tests/auto/blackbox/testdata
parentbb4622ac70ab43bb1e8f1930fc8430a3ec00eafb (diff)
Add support for gRPC to the protobuf.cpp module
This implements support for the gRPC framework: https://www.grpc.io Change-Id: Ia85461b9618e73827114c137fce8615e5a8139e3 Reviewed-by: Qbs CI Bot <travis-bot@weickelt.de> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'tests/auto/blackbox/testdata')
-rw-r--r--tests/auto/blackbox/testdata/grpc/grpc.cpp49
-rw-r--r--tests/auto/blackbox/testdata/grpc/grpc.proto15
-rw-r--r--tests/auto/blackbox/testdata/grpc/grpc_cpp.qbs26
3 files changed, 90 insertions, 0 deletions
diff --git a/tests/auto/blackbox/testdata/grpc/grpc.cpp b/tests/auto/blackbox/testdata/grpc/grpc.cpp
new file mode 100644
index 000000000..81995601d
--- /dev/null
+++ b/tests/auto/blackbox/testdata/grpc/grpc.cpp
@@ -0,0 +1,49 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 Ivan Komissarov
+** Contact: abbapoh@gmail.com
+**
+** This file is part of Qbs.
+**
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms and
+** conditions see http://www.qt.io/terms-conditions. For further information
+** use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 or version 3 as published by the Free
+** Software Foundation and appearing in the file LICENSE.LGPLv21 and
+** LICENSE.LGPLv3 included in the packaging of this file. Please review the
+** following information to ensure the GNU Lesser General Public License
+** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+****************************************************************************/
+
+#include <grpc.grpc.pb.h>
+
+class ServiceImpl final : public Qbs::Grpc::Service
+{
+ grpc::Status doWork(
+ grpc::ServerContext* context,
+ const Qbs::Request* request,
+ Qbs::Response* reply) override
+ {
+ (void)context;
+ reply->set_name(request->name());
+ return grpc::Status::OK;
+ }
+};
+
+int main(int, char**)
+{
+ return 0;
+}
diff --git a/tests/auto/blackbox/testdata/grpc/grpc.proto b/tests/auto/blackbox/testdata/grpc/grpc.proto
new file mode 100644
index 000000000..631006bad
--- /dev/null
+++ b/tests/auto/blackbox/testdata/grpc/grpc.proto
@@ -0,0 +1,15 @@
+syntax = "proto3";
+
+package Qbs;
+
+message Request {
+ string name = 1;
+}
+
+message Response {
+ string name = 1;
+}
+
+service Grpc {
+ rpc doWork(Request) returns (Response) {}
+}
diff --git a/tests/auto/blackbox/testdata/grpc/grpc_cpp.qbs b/tests/auto/blackbox/testdata/grpc/grpc_cpp.qbs
new file mode 100644
index 000000000..8ee3dd9c9
--- /dev/null
+++ b/tests/auto/blackbox/testdata/grpc/grpc_cpp.qbs
@@ -0,0 +1,26 @@
+import qbs
+
+CppApplication {
+ name: "grpc_cpp"
+ consoleApplication: true
+ condition: hasDependencies
+
+ Depends { name: "cpp" }
+ cpp.cxxLanguageVersion: "c++11"
+ cpp.warningLevel: "none"
+
+ Depends { name: "protobuf.cpp"; required: false }
+ protobuf.cpp.useGrpc: true
+
+ property bool hasDependencies: {
+ console.info("has grpc: " + protobuf.cpp.present);
+ return protobuf.cpp.present;
+ }
+
+ files: "grpc.cpp"
+
+ Group {
+ files: "grpc.proto"
+ fileTags: "protobuf.grpc"
+ }
+}