Add new build tests for protocol v2 59/288459/3
authorHwankyu Jhun <h.jhun@samsung.com>
Fri, 17 Feb 2023 00:43:22 +0000 (00:43 +0000)
committerHwankyu Jhun <h.jhun@samsung.com>
Fri, 17 Feb 2023 01:32:58 +0000 (01:32 +0000)
To test protocol v2, the build tests are added.

Change-Id: I41bc494cfbc5bfa6e62135e148829c3bad9fc33b
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
packaging/tidl.spec
tests/build_tests/CMakeLists.txt
tests/build_tests/prebuild.sh
tests/build_tests/tidl/Buffer_v2.tidl [new file with mode: 0644]
tests/build_tests/tidl/DataPort_v2.tidl [new file with mode: 0644]
tests/build_tests/tidl/Ex_v2.tidl [new file with mode: 0644]
tests/build_tests/tidl/Foo_v2.tidl [new file with mode: 0644]
tests/build_tests/tidl/Message_v2.tidl [new file with mode: 0644]

index 02aa99c360612b5d68ee97de74e8ec4dc0037d57..daee24f3e2b9636d7187156f680cd74cb3d42f81 100644 (file)
@@ -22,6 +22,8 @@ BuildRequires:  pkgconfig(bundle)
 BuildRequires:  pkgconfig(cion)
 BuildRequires:  pkgconfig(capi-appfw-event)
 BuildRequires:  pkgconfig(capi-appfw-app-common)
+BuildRequires:  pkgconfig(capi-appfw-app-manager)
+BuildRequires:  pkgconfig(capi-appfw-package-manager)
 
 %if 0%{?gcov:1}
 BuildRequires:  lcov
index 86865fac75c705cebb92d243759b2c9fe3fa60b3..913fee4cd3953629b4eee705d91db827e7f1e04a 100644 (file)
@@ -10,6 +10,8 @@ PKG_CHECK_MODULES(PKGS REQUIRED
   cion
   capi-appfw-event
   capi-appfw-app-common
+  capi-appfw-app-manager
+  capi-appfw-package-manager
 )
 
 FOREACH(flag ${PKGS_CFLAGS})
index d10db92c2e9c040184797d1bf16e568144309d8b..38ab951178b365f0e841f4b2a7968429bde76cf6 100755 (executable)
@@ -11,6 +11,12 @@ FILES[2]="Ex"
 FILES[3]="DataPort"
 FILES[4]="Foo"
 
+FILES_V2[0]="Message_v2"
+FILES_V2[1]="Buffer_v2"
+FILES_V2[2]="Ex_v2"
+FILES_V2[3]="DataPort_v2"
+FILES_V2[4]="Foo_v2"
+
 FILES_CION[0]="Message"
 FILES_CION[1]="Buffer"
 FILES_CION[2]="ExCion"
@@ -41,6 +47,18 @@ GenerateTIDL() {
     ${TIDLC} -s -n -l C -i ${SCRIPT_DIR}/tidl/${INPUT} -o ${TARGET_DIR}/${OUTPUT}
   done
 
+  for index in ${!FILES_V2[*]}; do
+    echo "Generate ${FILES_V2[index]}"
+
+    INPUT="${FILES_V2[index]}.tidl"
+
+    OUTPUT="${FILES_V2[index]}ProxyC"
+    ${TIDLC} -p -n -l C -i ${SCRIPT_DIR}/tidl/${INPUT} -o ${TARGET_DIR}/${OUTPUT}
+
+    OUTPUT="${FILES_V2[index]}StubC"
+    ${TIDLC} -s -n -l C -i ${SCRIPT_DIR}/tidl/${INPUT} -o ${TARGET_DIR}/${OUTPUT}
+  done
+
   for index in ${!FILES_FOR_GROUP[*]}; do
     echo "Generate ${FILES_FOR_GROUP[index]}"
 
diff --git a/tests/build_tests/tidl/Buffer_v2.tidl b/tests/build_tests/tidl/Buffer_v2.tidl
new file mode 100644 (file)
index 0000000..0bb3138
--- /dev/null
@@ -0,0 +1,8 @@
+protocol 2
+
+interface IRemoteBuffer {
+  void BufEvent(array<char> buf) delegate;
+
+  int GetFirst(string id, BufEvent ev, int max_size);
+  int GetNext(string id);
+}
diff --git a/tests/build_tests/tidl/DataPort_v2.tidl b/tests/build_tests/tidl/DataPort_v2.tidl
new file mode 100644 (file)
index 0000000..76df6e8
--- /dev/null
@@ -0,0 +1,30 @@
+protocol 2
+
+struct CursorContext {
+  int Handle;
+  enum position {
+    LEFT,
+    RIGHT,
+    CENTER,
+    TOP,
+    BOTTOM,
+  }
+}
+
+struct Pair {
+  string Key;
+  string Value;
+}
+
+interface DataPort {
+  CursorContext Query(string uri, list<string> projection, string selection, list<string> selectionArgs, string sortOrder);
+  int Insert(string uri, list<Pair> values);
+  int Update(string uri, list<Pair> values, string selection, list<string> selectionArgs);
+  int Delete(string uri, string selection, list<string> selectionArgs);
+
+  bool CursorIsLast(CursorContext cxt);
+  bool CursorMoveToFirst(CursorContext cxt);
+  bool CursorMoveToNext(CursorContext cxt);
+  string CursorGetString(CursorContext cxt, int column);
+  void CursorDispose(CursorContext cxt) async;
+}
diff --git a/tests/build_tests/tidl/Ex_v2.tidl b/tests/build_tests/tidl/Ex_v2.tidl
new file mode 100644 (file)
index 0000000..a05e9a0
--- /dev/null
@@ -0,0 +1,62 @@
+protocol 2
+
+struct StructTest {
+  int Int;
+  short Short;
+  char Char;
+  bundle Bd;
+  bool Fg;
+  string Str;
+  float Float;
+  double Double;
+  long Long;
+}
+
+struct Student {
+  string name;
+  int num;
+  bundle data;
+  array<char> extra;
+}
+
+struct Class {
+  string name;
+  list<Student> students;
+}
+
+[privilege = "http://tizen.org/privilege/appmanager.launch", privilege = "http://tizen.org/privilege/mediastorage",
+trusted = "true"]
+interface School {
+  void ClassAddedCB(int ret) delegate;
+  int T1(out bool b);
+  int T2(out char c);
+  int T3(out int l);
+  int T4(ref bool b);
+  int T5(ref char c);
+  int T6(ref int l);
+  int T7(out string str);
+  int T8(ref string str);
+  int Test1(out StructTest st);
+  int Test2(StructTest st);
+  int Test3(ref StructTest st);
+  int Test4(out list<StructTest> st);
+  int Test5(list<StructTest> st);
+  int Test6(ref list<StructTest> st);
+  int Test7(string st);
+  [privilege = "http://tizen.org/privilege/appmanager.launch", privilege = "http://tizen.org/privilege/alarm.set"]
+  int Test8(bundle st);
+
+  /// <summary>
+  /// Add class
+  /// </summary>
+  int AddClass(in Class cls);
+
+  /// <summary>
+  /// Add class async
+  /// </summary>
+  void AddClassAsync(Class cls, ClassAddedCB cb) async;
+
+  int GetStudent(in string c_name, in string s_name, out Student student);
+  int SetAllIds(list<list<int>> nums);
+  int SetExtra(string s_name, array<char> extra);
+}
diff --git a/tests/build_tests/tidl/Foo_v2.tidl b/tests/build_tests/tidl/Foo_v2.tidl
new file mode 100644 (file)
index 0000000..145f2a5
--- /dev/null
@@ -0,0 +1,11 @@
+protocol 2
+
+struct Foo {
+  int Age;
+  string Name;
+}
+
+interface Runnable {
+  int Run(Foo foo);
+  list<string> GetNames();
+}
diff --git a/tests/build_tests/tidl/Message_v2.tidl b/tests/build_tests/tidl/Message_v2.tidl
new file mode 100644 (file)
index 0000000..d3c4325
--- /dev/null
@@ -0,0 +1,18 @@
+protocol 2
+
+struct Envelope {
+  map<string, int> string_map;
+  set<double> double_set;
+  list<string> string_list;
+  array<bundle> bundle_array;
+}
+
+interface Message {
+  void NotifyCB(string sender, string msg) delegate;
+
+  int Register(string name, NotifyCB cb);
+  void Unregister() async;
+  int Send(string msg);
+  [privilege = "http://tizen.org/privilege/alarm.set"]
+  int SendEnvelope(string name, map<string, Envelope> envelope_map);
+}