BuildRequires: pkgconfig(tizen-hwc-server)
Requires: libwayland-extension-server
+# for gtest/gmock
+BuildRequires: pkgconfig(gmock)
+
# for recording video in enlightenment_info
BuildRequires: pkgconfig(wayland-client)
BuildRequires: pkgconfig(capi-media-streamrecorder)
%description devel
Development files for enlightenment
+%package tests
+Summary: enlightenment tests package
+Group: System/Libraries
+
+%description tests
+Tests binary for internal API in enlightenment
+
%prep
%setup -q -n %{name}-%{version}
cp %{SOURCE1001} .
/usr/bin/chsmack %{_bindir}/enlightenment_input_key* -a "System::Tools"
/usr/bin/chsmack %{_bindir}/enlightenment_info* -a "System::Tools"
/usr/bin/chsmack %{_bindir}/winfo* -a "System::Tools"
+/usr/bin/chsmack %{_bindir}/enlightenment-tests -a "System::Tools"
%files
%manifest %{name}.manifest
%defattr(-,root,root,-)
%{_includedir}/enlightenment/*
%{_libdir}/pkgconfig/*.pc
+
+%files tests
+%defattr(-,root,root,-)
+%attr(550,root,root) %{_bindir}/enlightenment-tests
--- /dev/null
+/**************************************************************************
+ *
+ * Copyright 2020 Samsung Electronics co., Ltd. All Rights Reserved.
+ *
+ * Contact: Konstantin Drabeniuk <k.drabeniuk@samsung.com>
+ * Contact: Andrii Sokolenko <a.sokolenko@samsung.com>
+ * Contact: Roman Marchenko <r.marchenko@samsung.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+**************************************************************************/
+
+#include "gmock/gmock.h"
+
+#ifdef TIZEN_TEST_GCOV
+extern "C" void __gcov_flush(void);
+#endif
+
+int main(int argc, char **argv)
+{
+ auto AllTestSuccess = false;
+
+#ifdef TIZEN_TEST_GCOV
+ setenv("GCOV_PREFIX", "/tmp", 1);
+#endif
+
+ try {
+ ::testing::InitGoogleMock(&argc, argv);
+ ::testing::FLAGS_gtest_death_test_style = "fast";
+ } catch ( ... ) {
+ std::cout << "error while trying to init google tests.\n";
+ exit(EXIT_FAILURE);
+ }
+
+ try {
+ AllTestSuccess = RUN_ALL_TESTS() == 0 ? true : false;
+ } catch (const ::testing::internal::GoogleTestFailureException & e) {
+ AllTestSuccess = false;
+ std::cout << "GoogleTestFailureException was thrown:" << e.what() << std::endl;
+ std::cout << "\n";
+ }
+
+#ifdef TIZEN_TEST_GCOV
+ __gcov_flush();
+#endif
+
+ return AllTestSuccess;
+}