ACLOCAL_AMFLAGS='-I m4'
SUBDIRS = src
+if IS_TESTS
+SUBDIRS += unittest
+endif
+
pcfiles = mm-evas-renderer.pc
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = $(pcfiles)
# Checks for programs.
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
AC_PROG_CC
+AC_PROG_CXX
AM_PROG_CC_C_O
AC_C_CONST
dnl AC_FUNC_MALLOC
AC_PROG_GCC_TRADITIONAL
AC_PROG_LIBTOOL
+AC_SUBST(GCC_CXXFLAGS)
+
PKG_CHECK_MODULES(MMCOMMON, mm-common)
AC_SUBST(MMCOMMON_CFLAGS)
AC_SUBST(MMCOMMON_LIBS)
AC_HEADER_STDC
AC_CHECK_HEADERS([fcntl.h stdlib.h string.h syslog.h unistd.h])
+AC_ARG_ENABLE(tests, AC_HELP_STRING([--enable-tests], [unittest build]),
+ [
+ case "${enableval}" in
+ yes) IS_TESTS=yes ;;
+ no) IS_TESTS=no ;;
+ *) AC_MSG_ERROR(bad value ${enableval} for --enable-tests) ;;
+ esac
+ ],
+[IS_TESTS=no])
+AM_CONDITIONAL([IS_TESTS], [test "x$IS_TESTS" = "xyes"])
+
+AS_IF([test "x$enable_tests" = "xyes"], [
+ PKG_CHECK_MODULES(GTESTS, gmock)
+ AC_SUBST(GTESTS_CFLAGS)
+ AC_SUBST(GTESTS_LIBS)
+])
+
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_CONST
AC_CONFIG_FILES([
Makefile
src/Makefile
+unittest/Makefile
mm-evas-renderer.pc
])
AC_OUTPUT
BuildRequires: pkgconfig(evas)
BuildRequires: pkgconfig(capi-media-tool)
BuildRequires: pkgconfig(libtbm)
+%if 0%{?gtests:1}
+BuildRequires: pkgconfig(gmock)
+%endif
%description
Multimedia Framework Evas Renderer Library files.
export CFLAGS+=" -DTIZEN_DEBUG"
./autogen.sh
%configure \
- --disable-static
+%if 0%{?gtests:1}
+ --enable-tests \
+%endif
+ --disable-static
make %{?jobs:-j%jobs}
%install
%license LICENSE.Apache-2.0
%defattr(-,root,root,-)
%{_libdir}/*.so.*
+%if 0%{?gtests:1}
+%{_bindir}/gtest-libmm-evas-renderer
+%endif
%files devel
%manifest %{name}.manifest
--- /dev/null
+# Unit tests
+bin_PROGRAMS = gtest-libmm-evas-renderer
+
+gtest_libmm_evas_renderer_SOURCES = libmm_evas_renderer_unittest.cpp
+
+gtest_libmm_evas_renderer_CXXFLAGS = -I$(top_srcdir)/src/include \
+ $(MMCOMMON_CFLAGS) \
+ $(MEDIAPACKET_CFLAGS) \
+ $(DLOG_CFLAGS) \
+ $(EVAS_CFLAGS) \
+ $(ECORE_CFLAGS) \
+ $(ELEMENTARY_CFLAGS) \
+ $(GLIB_CFLAGS) \
+ $(TBM_CFLAGS) \
+ $(GTESTS_CFLAGS) \
+ -Werror -Wno-deprecated -Wno-deprecated-declarations -Wno-cpp
+
+gtest_libmm_evas_renderer_DEPENDENCIES = $(top_srcdir)/src/.libs/libmmfevasrenderer.la
+
+gtest_libmm_evas_renderer_LDADD = \
+ $(GST_LIBS) \
+ $(MMCOMMON_LIBS) \
+ $(MEDIAPACKET_LIBS) \
+ $(DLOG_LIBS) \
+ $(EVAS_LIBS) \
+ $(ECORE_LIBS) \
+ $(ELEMENTARY_LIBS) \
+ $(GLIB_LIBS) \
+ $(TBM_LIBS) \
+ $(GTESTS_LIBS) \
+ $(top_srcdir)/src/.libs/libmmfevasrenderer.la
--- /dev/null
+/*
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#include "libmm_evas_renderer_unittest.h"
+
+using ::testing::InitGoogleTest;
+using ::testing::Test;
+using ::testing::TestCase;
+
+class libmm_evas_renderer_Test : public ::testing::Test {
+ protected:
+ void SetUp() {
+ std::cout << "SetUp()" << std::endl;
+ }
+
+ void TearDown() {
+ std::cout << "TearDown()" << std::endl;
+ }
+};
+
+TEST_F(libmm_evas_renderer_Test, mm_evas_renderer_create_p)
+{
+
+}
+
+TEST_F(libmm_evas_renderer_Test, mm_evas_renderer_create_n)
+{
+
+}
+
+gint main(gint argc, gchar **argv)
+{
+ InitGoogleTest(&argc, argv);
+
+ return RUN_ALL_TESTS();
+}
--- /dev/null
+/*
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __LIB_MM_EVAS_RENDERER_UNITTEST_H__
+#define __LIB_MM_EVAS_RENDERER_UNITTEST_H__
+
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+#include <mm_evas_renderer.h>
+#include <mm_evas_renderer_private.h>
+#include <mm_error.h>
+#undef LOG_TAG
+#define LOG_TAG "GTEST_LIB_MM_EVAS_RENDERER"
+
+#endif /*__LIB_MM_EVAS_RENDERER_UNITTEST_H__*/