SUBDIRS = src
+if GTESTS
+SUBDIRS += unittest
+endif
+
pcfiles = mm-display-interface.pc
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = $(pcfiles)
AC_HEADER_TIME
AC_PROG_GCC_TRADITIONAL
AC_PROG_LIBTOOL
+AC_PROG_CXX
+AC_SUBST(GCC_CXXFLAGS)
# Checks for libraries.
PKG_CHECK_MODULES(GLIB, glib-2.0)
AC_SUBST(TIZEN_EXTENSION_CLIENT_CFLAGS)
AC_SUBST(TIZEN_EXTENSION_CLIENT_LIBS)
+# Evas Renderer
AC_ARG_ENABLE(evas-renderer, AC_HELP_STRING([--enable-evas-renderer], [enable evas renderer]),
[
case "${enableval}" in
fi
AM_CONDITIONAL([TIZEN_FEATURE_EVAS_RENDERER], [test "x$TIZEN_FEATURE_EVAS_RENDERER" = "xyes"])
+# GTESTS
+AC_ARG_ENABLE(gtests, AC_HELP_STRING([--enable-gtests], [enable gtests]),
+[
+ case "${enableval}" in
+ yes) GTESTS=yes ;;
+ no) GTESTS=no ;;
+ *) AC_MSG_ERROR(bad value ${enableval} for --enable-gtests) ;;
+ esac
+],[GTESTS=no])
+if test "x$GTESTS" = "xyes"; then
+PKG_CHECK_MODULES(GMOCK, gmock)
+AC_SUBST(GMOCK_CFLAGS)
+AC_SUBST(GMOCK_LIBS)
+fi
+AM_CONDITIONAL([GTESTS], [test "x$GTESTS" = "xyes"])
+
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([fcntl.h memory.h stdlib.h string.h sys/time.h unistd.h])
AC_CONFIG_FILES([
Makefile
src/Makefile
+unittest/Makefile
mm-display-interface.pc
])
AC_OUTPUT
Name: libmm-display
Summary: Multimedia framework display library
-Version: 0.0.3
+Version: 0.0.4
Release: 0
Group: Multimedia/Libraries
License: Apache-2.0
%if "%{tizen_profile_name}" != "tv"
BuildRequires: pkgconfig(mm-evas-renderer)
%endif
+%if "%{gtests}" == "1"
+BuildRequires: pkgconfig(gmock)
+%endif
%description
Multimedia framework display library.
%if "%{tizen_profile_name}" != "tv"
--enable-evas-renderer \
%endif
+%if "%{gtests}" == "1"
+ --enable-gtests \
+%endif
--disable-static
make %{?jobs:-j%jobs}
%license LICENSE.APLv2
%defattr(-,root,root,-)
%{_libdir}/libmmfdisplay.so*
+%if "%{gtests}" == "1"
+%{_bindir}/gtests-libmm-display
+%endif
%files interface
%manifest libmm-display-interface.manifest
--- /dev/null
+bin_PROGRAMS = gtests-libmm-display
+
+gtests_libmm_display_SOURCES = gtests_libmm_display.cpp
+
+gtests_libmm_display_CXXFLAGS = \
+ -I$(top_srcdir)/src/include\
+ $(MM_COMMON_CFLAGS)\
+ $(MEDIA_TOOL_CFLAGS)\
+ $(GMOCK_CFLAGS)
+
+gtests_libmm_display_DEPENDENCIES = \
+ $(top_srcdir)/src/libmmfdisplay.la
+
+gtests_libmm_display_LDADD = \
+ $(GMOCK_LIBS)\
+ $(MEDIA_TOOL_LIBS)\
+ $(top_srcdir)/src/libmmfdisplay.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 <mm_error.h>
+#include "gtests_libmm_display.h"
+
+using namespace std;
+using ::testing::InitGoogleTest;
+using ::testing::Test;
+using ::testing::TestCase;
+
+
+
+class MMDisplayTestF : public ::testing::Test {
+ protected:
+ mm_display_h handle;
+
+ void SetUp() {
+ cout << "[SetUp]" << endl;
+ ASSERT_EQ(mm_display_init(&handle), MM_ERROR_NONE);
+ return;
+ }
+
+ void TearDown() {
+ cout << "[TearDown]" << endl << endl;
+ if (handle) {
+ mm_display_deinit(handle);
+ handle = NULL;
+ }
+ return;
+ }
+};
+
+TEST(MMDisplayTest, InitP)
+{
+ mm_display_h new_handle = NULL;
+
+ ASSERT_EQ(mm_display_init(&new_handle), MM_ERROR_NONE);
+
+ mm_display_deinit(new_handle);
+}
+
+TEST(MMDisplayTest, DeinitP)
+{
+ mm_display_h new_handle = NULL;
+
+ ASSERT_EQ(mm_display_init(&new_handle), MM_ERROR_NONE);
+
+ ASSERT_EQ(mm_display_deinit(new_handle), MM_ERROR_NONE);
+}
+
+
+int main(int argc, char **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 __MM_DISPLAY_UNITTEST_H__
+#define __MM_DISPLAY_UNITTEST_H__
+
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+#include <mm_display.h>
+
+#undef LOG_TAG
+#define LOG_TAG "GTEST_MM_DISPLAY"
+
+#endif /*__MM_DISPLAY_UNITTEST_H__*/