From d7159648e2f4c927e45075054781db38f1590c25 Mon Sep 17 00:00:00 2001 From: Hwankyu Jhun Date: Fri, 17 Feb 2023 00:43:22 +0000 Subject: [PATCH] Add new build tests for protocol v2 To test protocol v2, the build tests are added. Change-Id: I41bc494cfbc5bfa6e62135e148829c3bad9fc33b Signed-off-by: Hwankyu Jhun --- packaging/tidl.spec | 2 ++ tests/build_tests/CMakeLists.txt | 2 ++ tests/build_tests/prebuild.sh | 18 ++++++++++ tests/build_tests/tidl/Buffer_v2.tidl | 8 +++++ tests/build_tests/tidl/DataPort_v2.tidl | 30 ++++++++++++++++ tests/build_tests/tidl/Ex_v2.tidl | 62 +++++++++++++++++++++++++++++++++ tests/build_tests/tidl/Foo_v2.tidl | 11 ++++++ tests/build_tests/tidl/Message_v2.tidl | 18 ++++++++++ 8 files changed, 151 insertions(+) create mode 100644 tests/build_tests/tidl/Buffer_v2.tidl create mode 100644 tests/build_tests/tidl/DataPort_v2.tidl create mode 100644 tests/build_tests/tidl/Ex_v2.tidl create mode 100644 tests/build_tests/tidl/Foo_v2.tidl create mode 100644 tests/build_tests/tidl/Message_v2.tidl diff --git a/packaging/tidl.spec b/packaging/tidl.spec index 02aa99c..daee24f 100644 --- a/packaging/tidl.spec +++ b/packaging/tidl.spec @@ -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 diff --git a/tests/build_tests/CMakeLists.txt b/tests/build_tests/CMakeLists.txt index 86865fa..913fee4 100644 --- a/tests/build_tests/CMakeLists.txt +++ b/tests/build_tests/CMakeLists.txt @@ -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}) diff --git a/tests/build_tests/prebuild.sh b/tests/build_tests/prebuild.sh index d10db92..38ab951 100755 --- a/tests/build_tests/prebuild.sh +++ b/tests/build_tests/prebuild.sh @@ -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 index 0000000..0bb3138 --- /dev/null +++ b/tests/build_tests/tidl/Buffer_v2.tidl @@ -0,0 +1,8 @@ +protocol 2 + +interface IRemoteBuffer { + void BufEvent(array 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 index 0000000..76df6e8 --- /dev/null +++ b/tests/build_tests/tidl/DataPort_v2.tidl @@ -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 projection, string selection, list selectionArgs, string sortOrder); + int Insert(string uri, list values); + int Update(string uri, list values, string selection, list selectionArgs); + int Delete(string uri, string selection, list 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 index 0000000..a05e9a0 --- /dev/null +++ b/tests/build_tests/tidl/Ex_v2.tidl @@ -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 extra; +} + +struct Class { + string name; + list 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 st); + int Test5(list st); + int Test6(ref list st); + int Test7(string st); + [privilege = "http://tizen.org/privilege/appmanager.launch", privilege = "http://tizen.org/privilege/alarm.set"] + int Test8(bundle st); + + /// + /// Add class + /// + int AddClass(in Class cls); + + /// + /// Add class async + /// + void AddClassAsync(Class cls, ClassAddedCB cb) async; + + int GetStudent(in string c_name, in string s_name, out Student student); + int SetAllIds(list> nums); + int SetExtra(string s_name, array extra); +} diff --git a/tests/build_tests/tidl/Foo_v2.tidl b/tests/build_tests/tidl/Foo_v2.tidl new file mode 100644 index 0000000..145f2a5 --- /dev/null +++ b/tests/build_tests/tidl/Foo_v2.tidl @@ -0,0 +1,11 @@ +protocol 2 + +struct Foo { + int Age; + string Name; +} + +interface Runnable { + int Run(Foo foo); + list GetNames(); +} diff --git a/tests/build_tests/tidl/Message_v2.tidl b/tests/build_tests/tidl/Message_v2.tidl new file mode 100644 index 0000000..d3c4325 --- /dev/null +++ b/tests/build_tests/tidl/Message_v2.tidl @@ -0,0 +1,18 @@ +protocol 2 + +struct Envelope { + map string_map; + set double_set; + list string_list; + array 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 envelope_map); +} -- 2.7.4