From 20e1550213dc261d32f6ef1a2061c72be82618f4 Mon Sep 17 00:00:00 2001 From: fantasy-peak <1356346239@qq.com> Date: Mon, 2 Sep 2024 14:36:30 +0800 Subject: [PATCH] Use AddressSanitizer for test --- test_xmake.lua | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/test_xmake.lua b/test_xmake.lua index 84fa772..d9c31dd 100644 --- a/test_xmake.lua +++ b/test_xmake.lua @@ -9,7 +9,7 @@ add_requires("cppzmq", {system = false}) add_requires("msgpack-cxx", {system = false}) set_policy("check.auto_ignore_flags", false) -add_cxflags("-O2 -Wall -Wextra -pedantic-errors -Wno-missing-field-initializers -Wno-ignored-qualifiers") +add_cxflags("-O2 -Wall -Wextra -pedantic-errors -Wno-missing-field-initializers -Wno-ignored-qualifiers -fsanitize=address") add_includedirs("./out/include") target("bi") @@ -17,7 +17,7 @@ target("bi") set_kind("binary") add_files("test/cpp/bi.cpp") add_packages("msgpack-cxx", "nlohmann_json", "cppzmq", "spdlog", "asio") - add_syslinks("pthread", "uuid") + add_syslinks("pthread", "uuid", "asan") target_end() target("coro_bi") @@ -25,7 +25,7 @@ target("coro_bi") set_kind("binary") add_files("test/cpp/coro_bi.cpp") add_packages("msgpack-cxx", "nlohmann_json", "cppzmq", "spdlog", "asio") - add_syslinks("pthread", "uuid") + add_syslinks("pthread", "uuid", "asan") target_end() target("coro_frpc_bi") @@ -33,7 +33,7 @@ target("coro_frpc_bi") set_kind("binary") add_files("test/cpp/coro_frpc_bi.cpp") add_packages("msgpack-cxx", "nlohmann_json", "cppzmq", "spdlog", "asio") - add_syslinks("pthread", "uuid") + add_syslinks("pthread", "uuid", "asan") target_end() target("uni_pub_sub") @@ -41,7 +41,7 @@ target("uni_pub_sub") set_kind("binary") add_files("test/cpp/uni_pub_sub.cpp") add_packages("msgpack-cxx", "nlohmann_json", "cppzmq", "spdlog", "asio") - add_syslinks("pthread", "uuid") + add_syslinks("pthread", "uuid", "asan") target_end() target("coro_uni_pub_sub") @@ -49,7 +49,7 @@ target("coro_uni_pub_sub") set_kind("binary") add_files("test/cpp/uni_pub_sub.cpp") add_packages("msgpack-cxx", "nlohmann_json", "cppzmq", "spdlog", "asio") - add_syslinks("pthread", "uuid") + add_syslinks("pthread", "uuid", "asan") target_end() target("uni_push_pull") @@ -57,7 +57,7 @@ target("uni_push_pull") set_kind("binary") add_files("test/cpp/uni_push_pull.cpp") add_packages("msgpack-cxx", "nlohmann_json", "cppzmq", "spdlog", "asio") - add_syslinks("pthread", "uuid") + add_syslinks("pthread", "uuid", "asan") target_end() target("coro_uni_push_pull") @@ -65,7 +65,7 @@ target("coro_uni_push_pull") set_kind("binary") add_files("test/cpp/uni_push_pull.cpp") add_packages("msgpack-cxx", "nlohmann_json", "cppzmq", "spdlog", "asio") - add_syslinks("pthread", "uuid") + add_syslinks("pthread", "uuid", "asan") target_end() target("coro_bi_stream") @@ -73,5 +73,5 @@ target("coro_bi_stream") set_kind("binary") add_files("test/cpp/bi_stream.cpp") add_packages("msgpack-cxx", "nlohmann_json", "cppzmq", "spdlog", "asio") - add_syslinks("pthread", "uuid") + add_syslinks("pthread", "uuid", "asan") target_end()