tools: resource-monitor: Add hal-api-foo test code sandbox/chanwoochoi/hal-api-foo-test
authorChanwoo Choi <cw00.choi@samsung.com>
Mon, 8 Jan 2024 08:34:44 +0000 (17:34 +0900)
committerChanwoo Choi <cw00.choi@samsung.com>
Mon, 8 Jan 2024 08:34:44 +0000 (17:34 +0900)
Change-Id: If356674e4b45826846243a3a1e6c77f07b32321e
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
packaging/pass.spec
tools/resource-monitor/CMakeLists.txt
tools/resource-monitor/resource-monitor.c

index f2384f29bf00c438a3ba3b1fe08f093de7ec67ae..b77fb2954512a04009142c4807e1341713682be4 100644 (file)
@@ -31,6 +31,7 @@ BuildRequires:  pkgconfig(json-c)
 BuildRequires:  pkgconfig(hal-api-power)
 BuildRequires:  pkgconfig(cynara-client)
 BuildRequires:  pkgconfig(cynara-session)
+BuildRequires:  pkgconfig(hal-api-foo)
 
 %description
 PASS  (Power-Aware System Service)
index 8746e13bb95a15e5b876cfcaba7bd3a297eabb5d..a45a93b79c54bc706518acdc4168c47a9fc6876e 100644 (file)
@@ -20,6 +20,7 @@ pkg_check_modules(gtest_pkgs REQUIRED
        json-c
        cynara-client
        cynara-session
+       hal-api-foo
 )
 
 FOREACH(flag ${gtest_pkgs_CFLAGS})
index 47dba1e7e36f882eb9815ec184eab19d333fe43b..8ce68568e3e409acfb22e8d1a51964c09a84c6a0 100644 (file)
@@ -32,6 +32,8 @@
 
 #include "resource-monitor.h"
 
+#include <hal/hal-foo.h>
+
 #define BUFF_MAX       255
 #define MAX_RESOURCE   100
 #define MAX_ATTR       64
@@ -528,6 +530,8 @@ static void resource_monitor(void)
        int count = 0;
        int i, j;
 
+       hal_foo_get_backend();
+
        while (1) {
                if (g_data.max != -1 && g_data.max <= count++)
                        break;
@@ -551,7 +555,13 @@ static void resource_monitor(void)
                        printf("\n");
                }
                sleep(g_data.secs);
+
+               printf("hal_foo_start() : %d\n", hal_foo_start());
+               printf("hal_foo_stop()  : %d\n", hal_foo_stop());
        }
+
+       hal_foo_put_backend();
+
        resource_monitor_exit(0);
 }