From af4ac43ef34a9e5437610f47978cce9bbf50fa19 Mon Sep 17 00:00:00 2001 From: "zhusiyu (E)" Date: Mon, 27 Oct 2025 10:06:34 +0800 Subject: [PATCH] bugfix: adapt kupl print info --- kupl/test/test_main.cpp | 36 +++++++++++++++++++++++++++++++++--- kupl/test/test_sgraph.cpp | 9 +++------ 2 files changed, 36 insertions(+), 9 deletions(-) diff --git a/kupl/test/test_main.cpp b/kupl/test/test_main.cpp index fdd9303..0f7039a 100644 --- a/kupl/test/test_main.cpp +++ b/kupl/test/test_main.cpp @@ -1,8 +1,38 @@ #include "gtest/gtest.h" +#include +#include + +class CustomTestEventListener : public::testing::EmptyTestEventListener { +public: + CustomTestEventListener() { + } + + ~CustomTestEventListener() override { + } + + void OnTestStart(const::testing::TestInfo& test_info) override { + std::cout << "start test " <listeners(); + delete listeners.Release(listeners.default_result_printer()); + listeners.Append(new CustomTestEventListener()); + + return RUN_ALL_TESTS(); } \ No newline at end of file diff --git a/kupl/test/test_sgraph.cpp b/kupl/test/test_sgraph.cpp index efaa506..e39eebf 100644 --- a/kupl/test/test_sgraph.cpp +++ b/kupl/test/test_sgraph.cpp @@ -8,9 +8,6 @@ kupl_sgraph_node_h task_gnode_3; static inline void task_str(void *args) { - const char *str = (const char*)args; - printf("[thread:%lu] get string %s\n", pthread_self(), str); - usleep(10000); } static kupl_sgraph_node_h add_node(kupl_sgraph_h sgraph, const char *text) @@ -27,11 +24,11 @@ TEST(test_sgraph, kupl_sgraph_001) sgraph = kupl_sgraph_create(); ASSERT_TRUE(sgraph != nullptr); - task_gnode_1 = add_node(sgraph, "static a"); + task_gnode_1 = add_node(sgraph, nullptr); ASSERT_TRUE(task_gnode_1 != nullptr); - task_gnode_2 = add_node(sgraph, "static b"); + task_gnode_2 = add_node(sgraph, nullptr); ASSERT_TRUE(task_gnode_2 != nullptr); - task_gnode_3 = add_node(sgraph, "static c"); + task_gnode_3 = add_node(sgraph, nullptr); ASSERT_TRUE(task_gnode_3 != nullptr); int ret = kupl_sgraph_add_dep(task_gnode_1, task_gnode_2); -- Gitee