#cp -af mmifw_stub.* ./src/mmimgr/interface/
%build
+CFLAGS+=" -fprofile-arcs -ftest-coverage -DTIZEN_TEST_GCOV"
+CXXFLAGS+=" -fprofile-arcs -ftest-coverage -DTIZEN_TEST_GCOV"
+LDFLAGS+=" -lgcov"
meson setup --prefix=/usr \
--bindir %{_bindir} \
--libdir %{_libdir} \
-#include <gtest/gtest.h>
#include <gmock/gmock.h>
+#define PRINT printf
+
+#ifdef TIZEN_TEST_GCOV
+extern "C" void __gcov_flush(void);
+#endif
+
int main(int argc, char** argv) {
- testing::InitGoogleTest(&argc, argv);
- return RUN_ALL_TESTS();
+ auto testResults = false;
+#ifdef TIZEN_TEST_GCOV
+ setenv("GCOV_PREFIX", "/tmp", 1);
+#endif
+ try
+ {
+ testing::InitGoogleMock(&argc, argv);
+ testing::FLAGS_gtest_death_test_style = "fast";
+ }
+ catch ( ... )
+ {
+ PRINT("Error occurred while trying to initialize GoogleTest.\n");
+ exit(EXIT_FAILURE);
+ }
+
+ try
+ {
+ testResults = (RUN_ALL_TESTS() == 0) ? true : false;
+ }
+ catch (const ::testing::internal::GoogleTestFailureException &e)
+ {
+ testResults = false;
+ PRINT("GoogleTestFailureException has been thrown: %s\n", e.what());
+ }
+
+#ifdef TIZEN_TEST_GCOV
+ __gcov_flush();
+#endif
+ return testResults;
}
{
auto testResults = false;
+#ifdef TIZEN_TEST_GCOV
+ setenv("GCOV_PREFIX", "/tmp", 1);
+#endif
try
{
::testing::InitGoogleMock(&argc, argv);
PRINT("GoogleTestFailureException has been thrown: %s\n", e.what());
}
+#ifdef TIZEN_TEST_GCOV
+ __gcov_flush();
+#endif
return testResults;
}
#define PRINT printf
+#ifdef TIZEN_TEST_GCOV
+extern "C" void __gcov_flush(void);
+#endif
+
using ::testing::TestWithParam;
using ::testing::Bool;
using ::testing::Values;
{
auto testResults = false;
+#ifdef TIZEN_TEST_GCOV
+ setenv("GCOV_PREFIX", "/tmp", 1);
+#endif
try
{
::testing::InitGoogleMock(&argc, argv);
PRINT("GoogleTestFailureException has been thrown: %s\n", e.what());
}
+#ifdef TIZEN_TEST_GCOV
+ __gcov_flush();
+#endif
return testResults;
}
#define PRINT printf
+#ifdef TIZEN_TEST_GCOV
+extern "C" void __gcov_flush(void);
+#endif
extern void wait_for_dispatch();
using ::testing::TestWithParam;
{
auto testResults = false;
+#ifdef TIZEN_TEST_GCOV
+ setenv("GCOV_PREFIX", "/tmp", 1);
+#endif
try
{
::testing::InitGoogleMock(&argc, argv);
PRINT("GoogleTestFailureException has been thrown: %s\n", e.what());
}
+#ifdef TIZEN_TEST_GCOV
+ __gcov_flush();
+#endif
return testResults;
}
#define PRINT printf
+#ifdef TIZEN_TEST_GCOV
+extern "C" void __gcov_flush(void);
+#endif
+
using ::testing::TestWithParam;
using ::testing::Bool;
using ::testing::Values;