add unittest for video360 20/194120/1
authorSejun Park <sejun79.park@samsung.com>
Thu, 29 Nov 2018 07:31:42 +0000 (16:31 +0900)
committerSejun Park <sejun79.park@samsung.com>
Thu, 29 Nov 2018 07:31:42 +0000 (16:31 +0900)
Change-Id: I09de3e8370d5476dc00313dee65693f54b17f108

configure.ac
packaging/gst-plugins-tizen.spec
video360/Makefile.am
video360/unittest/Makefile.am [new file with mode: 0644]
video360/unittest/gtest_video360.cpp [new file with mode: 0644]
video360/unittest/gtest_video360.h [new file with mode: 0644]

index df2c8a2..7494e99 100644 (file)
@@ -509,6 +509,7 @@ wfdtizenmanager/Makefile
 alfec/Makefile
 video360/Makefile
 video360/src/Makefile
+video360/unittest/Makefile
 tizenwlsink/Makefile
 tizenwlsink/src/Makefile
 tizencamerasrc/Makefile
index 5d41a28..c47b393 100644 (file)
@@ -9,7 +9,7 @@
 Name:       gst-plugins-tizen
 Version:    1.0.0
 Summary:    GStreamer tizen plugins (common)
-Release:    61
+Release:    62
 Group:      Multimedia/Framework
 Url:        http://gstreamer.freedesktop.org/
 License:    LGPL-2.1+
index af437a6..5008a5c 100644 (file)
@@ -1 +1,5 @@
 SUBDIRS = src
+
+if IS_TESTS
+SUBDIRS += unittest
+endif
diff --git a/video360/unittest/Makefile.am b/video360/unittest/Makefile.am
new file mode 100644 (file)
index 0000000..c916587
--- /dev/null
@@ -0,0 +1,13 @@
+bin_PROGRAMS = gtest-video360
+
+gtest_video360_SOURCES = gtest_video360.cpp
+
+gtest_video360_CXXFLAGS = \
+                       -I$(top_srcdir)/video360/src \
+                       $(GTESTS_CFLAGS) \
+                       $(GLES_CFLAGS)
+
+gtest_video360_LDADD = \
+                       $(top_builddir)/video360/src/libgstvideo360.la \
+                       $(GTESTS_LIBS) \
+                       $(GLES_LIBS)
diff --git a/video360/unittest/gtest_video360.cpp b/video360/unittest/gtest_video360.cpp
new file mode 100644 (file)
index 0000000..1f6ac62
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * 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 "gtest_video360.h"
+
+using ::testing::InitGoogleTest;
+using ::testing::Test;
+using ::testing::TestCase;
+
+class video360_Test : public ::testing::Test {
+       protected:
+               void SetUp() {
+                       std::cout << "SetUp()" << std::endl;
+               }
+
+               void TearDown() {
+                       std::cout << "TearDown()" << std::endl;
+               }
+};
+
+TEST(video360_Test, _video360_egl_bind)
+{
+       EGLBoolean ret;
+
+       ret = eglBindAPI(EGL_OPENGL_ES_API);
+
+       EXPECT_EQ(ret, EGL_TRUE);
+}
+
+int main(int argc, char **argv)
+{
+       InitGoogleTest(&argc, argv);
+
+       return RUN_ALL_TESTS();
+}
diff --git a/video360/unittest/gtest_video360.h b/video360/unittest/gtest_video360.h
new file mode 100644 (file)
index 0000000..72076f2
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * 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 __VIDEO360_UNITTEST_H__
+#define __VIDEO360_UNITTEST_H__
+
+#include <EGL/egl.h>
+#include <EGL/eglext.h>
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+
+#undef LOG_TAG
+#define LOG_TAG                "GTEST_VIDEO360"
+
+#endif /*__VIDEO360_UNITTEST_H__*/