Change-Id: I42afb291c67ea952503ef1559bfb7d8de41381d7
%bcond_with x
%bcond_with wayland
%define UTEST_PACKAGE 1
+%define UTEST_GCOV 0
Name: libtbm
Version: 2.3.0
UTEST="yes"
%endif
+%if "%{UTEST_GCOV}" == "1"
+CFLAGS+=" -fprofile-arcs -ftest-coverage -DTIZEN_TEST_GCOV"
+CXXFLAGS+=" -fprofile-arcs -ftest-coverage -DTIZEN_TEST_GCOV"
+LDFLAGS+=" -lgcov"
+%endif
+
%if %{with wayland}
%reconfigure --prefix=%{_prefix} --with-tbm-platform=WAYLAND --with-utests=${UTEST} \
CFLAGS="${CFLAGS} -Wall -Werror" LDFLAGS="${LDFLAGS} -Wl,--hash-style=both -Wl,--as-needed"
-I./ \
-I$(top_srcdir) \
-I$(top_srcdir)/src \
- @LIBTBM_CFLAGS@
+ @LIBTBM_CFLAGS@ \
+ $(CFLAGS)
libtbm_la_LTLIBRARIES = libtbm.la
libtbm_ladir = $(libdir)
-libtbm_la_LDFLAGS = -version-number 1:0:0 -no-undefined
+libtbm_la_LDFLAGS = $(LDFLAGS) -version-number 1:0:0 -no-undefined
libtbm_la_LIBADD = @LIBTBM_LIBS@ @CLOCK_LIB@ -ldl
libtbm_la_SOURCES = \
#include "gtest/gtest.h"
+#ifdef TIZEN_TEST_GCOV
+extern "C" void __gcov_flush(void);
+#endif
+
int main(int argc, char **argv)
{
+
+#ifdef TIZEN_TEST_GCOV
+ setenv("GCOV_PREFIX", "/tmp", 1);
+#endif
+
try {
::testing::InitGoogleTest(&argc, argv);
::testing::FLAGS_gtest_death_test_style = "fast";
exit(EXIT_FAILURE);
}
+#ifdef TIZEN_TEST_GCOV
+ __gcov_flush();
+#endif
+
return RUN_ALL_TESTS();
}