Add initial code for GTest
[platform/core/connectivity/zigbee-manager.git] / zigbee-daemon / src / main.c
index 78639c3..14439d3 100644 (file)
 /**< ZigBee Service */
 ZigBeeService *zigbee_service;
 
+#if (BUILD_GCOV != 0)
+extern void __gcov_flush(void);
+#endif
+
 static gboolean _request_terminate(gpointer user_data)
 {
        NOTUSED(user_data);
@@ -58,6 +62,10 @@ int main(int arg, char **argv)
        NOTUSED(arg);
        NOTUSED(argv);
 
+#if (BUILD_GCOV != 0)
+       setenv("GCOV_PREFIX", "/tmp/", 1);
+#endif
+
        /* Create ZigBee service */
        zigbee_service = service = zblib_service_new();
 
@@ -95,5 +103,9 @@ END:
        zblib_service_free(service);
        zigbee_service = NULL;
 
+#if (BUILD_GCOV != 0)
+       __gcov_flush();
+#endif
+
        return ret_code;
 }