summaryrefslogtreecommitdiff
path: root/tests/projects
diff options
context:
space:
mode:
authorOpportunityLiu <[email protected]>2019-07-02 13:58:28 +0800
committerOpportunityLiu <[email protected]>2019-07-02 13:58:28 +0800
commit0b9ed8ef1139530d732331d65280ef003213cc09 (patch)
tree0423c8f6a21132ec7141289d80bec009491835a4 /tests/projects
parent7d43ca494348e21400285c86be66872adb7e54d8 (diff)
parentdb0b2ae6096ea05dc990ac7d975e194cca75035e (diff)
merge dev
Diffstat (limited to 'tests/projects')
-rw-r--r--tests/projects/c++/protobuf/src/main.cpp10
-rw-r--r--tests/projects/c++/protobuf/src/test.proto8
-rw-r--r--tests/projects/c++/protobuf/xmake.lua23
-rw-r--r--tests/projects/c/protobuf/src/main.c7
-rw-r--r--tests/projects/c/protobuf/src/test.proto8
-rw-r--r--tests/projects/c/protobuf/xmake.lua20
6 files changed, 76 insertions, 0 deletions
diff --git a/tests/projects/c++/protobuf/src/main.cpp b/tests/projects/c++/protobuf/src/main.cpp
new file mode 100644
index 000000000..1e7830c17
--- /dev/null
+++ b/tests/projects/c++/protobuf/src/main.cpp
@@ -0,0 +1,10 @@
+#include <iostream>
+#include "test.pb.h"
+
+using namespace std;
+
+int main(int argc, char** argv)
+{
+ cout << "hello world!" << endl;
+ return 0;
+}
diff --git a/tests/projects/c++/protobuf/src/test.proto b/tests/projects/c++/protobuf/src/test.proto
new file mode 100644
index 000000000..0f129ea13
--- /dev/null
+++ b/tests/projects/c++/protobuf/src/test.proto
@@ -0,0 +1,8 @@
+syntax = "proto3";
+package test;
+message TestCase {
+ string name = 4;
+}
+message Test {
+ repeated TestCase case = 1;
+}
diff --git a/tests/projects/c++/protobuf/xmake.lua b/tests/projects/c++/protobuf/xmake.lua
new file mode 100644
index 000000000..da8f1ee16
--- /dev/null
+++ b/tests/projects/c++/protobuf/xmake.lua
@@ -0,0 +1,23 @@
+
+-- add rules: debug and release
+add_rules("mode.debug", "mode.release")
+
+-- add protobuf
+add_requires("protobuf-cpp")
+
+-- add target
+target("console_c++")
+
+ -- set kind
+ set_kind("binary")
+
+ -- set languages
+ set_languages("c++11")
+
+ -- add packages
+ add_packages("protobuf-cpp")
+
+ -- add files
+ add_files("src/*.cpp")
+ add_files("src/*.proto", {rules = "protobuf.cpp"})
+
diff --git a/tests/projects/c/protobuf/src/main.c b/tests/projects/c/protobuf/src/main.c
new file mode 100644
index 000000000..1f0458b66
--- /dev/null
+++ b/tests/projects/c/protobuf/src/main.c
@@ -0,0 +1,7 @@
+#include <stdio.h>
+#include "test.pb-c.h"
+
+int main(int argc, char** argv)
+{
+ return 0;
+}
diff --git a/tests/projects/c/protobuf/src/test.proto b/tests/projects/c/protobuf/src/test.proto
new file mode 100644
index 000000000..0f129ea13
--- /dev/null
+++ b/tests/projects/c/protobuf/src/test.proto
@@ -0,0 +1,8 @@
+syntax = "proto3";
+package test;
+message TestCase {
+ string name = 4;
+}
+message Test {
+ repeated TestCase case = 1;
+}
diff --git a/tests/projects/c/protobuf/xmake.lua b/tests/projects/c/protobuf/xmake.lua
new file mode 100644
index 000000000..151acf5b4
--- /dev/null
+++ b/tests/projects/c/protobuf/xmake.lua
@@ -0,0 +1,20 @@
+
+-- add rules: debug and release
+add_rules("mode.debug", "mode.release")
+
+-- add protobuf
+add_requires("protobuf-c")
+
+-- add target
+target("console_c")
+
+ -- set kind
+ set_kind("binary")
+
+ -- add packages
+ add_packages("protobuf-c")
+
+ -- add files
+ add_files("src/*.c")
+ add_files("src/*.proto", {rules = "protobuf.c"})
+