From 45556fac092f98d3cf599de5002e966e7cdfe925 Mon Sep 17 00:00:00 2001 From: Hwankyu Jhun Date: Wed, 20 Oct 2021 10:10:38 +0900 Subject: [PATCH] Add CION build tests to tidl-build-tests - Removes CXX from cmake project definition - Generates CION codes using tidlc before building tidl-build-tests Change-Id: Iabf3e11365adcfb0868a8ccd848721341e4f012d Signed-off-by: Hwankyu Jhun --- CMakeLists.txt | 2 +- packaging/tidl.spec | 1 + tests/build_tests/CMakeLists.txt | 29 ++++++++++++++++++++++++++--- tests/build_tests/prebuild.sh | 25 ++++++++++++++++++++----- 4 files changed, 48 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d698f6e..99e1da6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8) -PROJECT(tidlc CXX) +PROJECT(tidlc) INCLUDE(FindPkgConfig) diff --git a/packaging/tidl.spec b/packaging/tidl.spec index 58fef6a..4e3976a 100644 --- a/packaging/tidl.spec +++ b/packaging/tidl.spec @@ -19,6 +19,7 @@ BuildRequires: pkgconfig(glib-2.0) BuildRequires: pkgconfig(dlog) BuildRequires: pkgconfig(rpc-port) BuildRequires: pkgconfig(bundle) +BuildRequires: pkgconfig(cion) %if 0%{?gcov:1} BuildRequires: lcov %endif diff --git a/tests/build_tests/CMakeLists.txt b/tests/build_tests/CMakeLists.txt index e086a0f..730a9b7 100644 --- a/tests/build_tests/CMakeLists.txt +++ b/tests/build_tests/CMakeLists.txt @@ -2,35 +2,58 @@ SET(TOOL_TIDLC "${CMAKE_CURRENT_SOURCE_DIR}/../../idlc/tidlc") SET(TARGET_PREBUILD_SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/prebuild.sh") INCLUDE(FindPkgConfig) -PKG_CHECK_MODULES(PKGS REQUIRED dlog glib-2.0 rpc-port bundle) +PKG_CHECK_MODULES(PKGS REQUIRED dlog glib-2.0 rpc-port bundle cion) FOREACH(flag ${PKGS_CFLAGS}) SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") ENDFOREACH(flag) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CFLAGS} -fPIE -Werror") -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFALGS} -fPIE -Werror") +SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIE -Werror") SET(CMAKE_EXE_LINKER_FLAGS "-pie -Wl,--as-needed") AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR} TIDL_BUILD_TESTS_SRCS) SET(TIDL_GEN_SRCS + BufferCionProxy.cc + BufferCionProxyC.c + BufferCionStub.cc + BufferCionStubC.c BufferProxy.cc BufferProxyC.c BufferStub.cc BufferStubC.c + DataPortCionProxy.cc + DataPortCionProxyC.c + DataPortCionStub.cc + DataPortCionStubC.c DataPortProxy.cc DataPortProxyC.c DataPortStub.cc DataPortStubC.c + ExCionProxy.cc + ExCionProxyC.c + ExCionStub.cc + ExCionStubC.c ExProxy.cc ExProxyC.c ExStub.cc ExStubC.c + FooCionProxy.cc + FooCionProxyC.c + FooCionStub.cc + FooCionStubC.c + FooProxy.cc + FooProxyC.c + FooStub.cc + FooStubC.c + MessageCionProxy.cc + MessageCionProxyC.c + MessageCionStub.cc + MessageCionStubC.c MessageProxy.cc MessageProxyC.c MessageStub.cc - MessageStubC.c ) ADD_CUSTOM_COMMAND(OUTPUT ${TIDL_GEN_SRCS} PRE_BUILD diff --git a/tests/build_tests/prebuild.sh b/tests/build_tests/prebuild.sh index 16a0d63..5f4e2c5 100755 --- a/tests/build_tests/prebuild.sh +++ b/tests/build_tests/prebuild.sh @@ -16,20 +16,35 @@ GenerateTIDL() { echo "Generate ${FILES[index]}" INPUT="${FILES[index]}.tidl" - OUTPUT="${FILES[index]}Stub" - ${TIDLC} -s -l C++ -i ${SCRIPT_DIR}/tidl/${INPUT} -o ${TARGET_DIR}/${OUTPUT} OUTPUT="${FILES[index]}Proxy" ${TIDLC} -p -l C++ -i ${SCRIPT_DIR}/tidl/${INPUT} -o ${TARGET_DIR}/${OUTPUT} - OUTPUT="${FILES[index]}StubC" - ${TIDLC} -s -n -l C -i ${SCRIPT_DIR}/tidl/${INPUT} -o ${TARGET_DIR}/${OUTPUT} + OUTPUT="${FILES[index]}Stub" + ${TIDLC} -s -l C++ -i ${SCRIPT_DIR}/tidl/${INPUT} -o ${TARGET_DIR}/${OUTPUT} OUTPUT="${FILES[index]}ProxyC" ${TIDLC} -p -n -l C -i ${SCRIPT_DIR}/tidl/${INPUT} -o ${TARGET_DIR}/${OUTPUT} + + OUTPUT="${FILES[index]}StubC" + ${TIDLC} -s -n -l C -i ${SCRIPT_DIR}/tidl/${INPUT} -o ${TARGET_DIR}/${OUTPUT} + + OUTPUT="${FILES[index]}CionProxy" + ${TIDLC} -p -n -c -l C++ -i ${SCRIPT_DIR}/tidl/${INPUT} -o ${TARGET_DIR}/${OUTPUT} + + OUTPUT="${FILES[index]}CionStub" + ${TIDLC} -s -n -c -l C++ -i ${SCRIPT_DIR}/tidl/${INPUT} -o ${TARGET_DIR}/${OUTPUT} + + OUTPUT="${FILES[index]}CionProxyC" + ${TIDLC} -p -n -c -l C -i ${SCRIPT_DIR}/tidl/${INPUT} -o ${TARGET_DIR}/${OUTPUT} + + OUTPUT="${FILES[index]}CionStubC" + ${TIDLC} -s -n -c -l C -i ${SCRIPT_DIR}/tidl/${INPUT} -o ${TARGET_DIR}/${OUTPUT} done } +echo "############ Generate codes using TIDLC ############" + GenerateTIDL -echo "Done" +echo "############ Done ############" -- 2.7.4