diff --git a/BUILD.gn b/BUILD.gn index fb03765379..6a925ab4ba 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -36,14 +36,4 @@ group("ten_framework_all") { if (ten_enable_test) { deps += [ "//tests" ] } - - if (enable_sanitizer) { - if (!is_clang) { - # If the sanitizer is enabled, the libasan.so will be needed in many test - # scenarios. Therefore, it is copied to the root_out_dir for unified - # usage. - deps += - [ "//build/common/asan:package_asan_lib_for_ten_framework_itself" ] - } - } } diff --git a/build/common/asan/BUILD.gn b/build/common/asan/BUILD.gn index 5ec3893ba9..4b06d369e2 100644 --- a/build/common/asan/BUILD.gn +++ b/build/common/asan/BUILD.gn @@ -6,6 +6,6 @@ # import("//build/common/asan/package_asan_lib.gni") -package_asan_lib("package_asan_lib_for_ten_framework_itself") { - dest_asan_lib_dir = "${root_out_dir}" +package_asan_lib("package_asan_lib_for_ten_framework_standalone_test") { + dest_asan_lib_dir = "${root_out_dir}/tests/standalone" } diff --git a/tests/ten_runtime/smoke/BUILD.gn b/tests/ten_runtime/smoke/BUILD.gn index f10f2871ec..e5dfdc20cb 100644 --- a/tests/ten_runtime/smoke/BUILD.gn +++ b/tests/ten_runtime/smoke/BUILD.gn @@ -77,6 +77,12 @@ ten_executable("ten_runtime_smoke_test") { ] } + if (enable_sanitizer) { + if (!is_clang) { + deps += [ "//build/common/asan:package_asan_lib_for_ten_framework_standalone_test" ] + } + } + sources = [ "//third_party/googletest/src/gtest_main.cc" ] public_deps = [ diff --git a/tests/ten_runtime/unit/BUILD.gn b/tests/ten_runtime/unit/BUILD.gn index 14bf32fd94..28c70d49d3 100644 --- a/tests/ten_runtime/unit/BUILD.gn +++ b/tests/ten_runtime/unit/BUILD.gn @@ -31,6 +31,13 @@ ten_executable("ten_runtime_unit_test") { "//core/src/ten_utils", "//tests/ten_runtime:copy_libraries_for_test", ] + + if (enable_sanitizer) { + if (!is_clang) { + deps += [ "//build/common/asan:package_asan_lib_for_ten_framework_standalone_test" ] + } + } + sources = [ "//third_party/googletest/src/gtest_main.cc" ] public_deps = [ diff --git a/tests/ten_utils/BUILD.gn b/tests/ten_utils/BUILD.gn index 892a2fe1cd..71499436a6 100644 --- a/tests/ten_utils/BUILD.gn +++ b/tests/ten_utils/BUILD.gn @@ -10,6 +10,13 @@ import("//build/ten_utils/utils.gni") ten_utils_test("ten_utils_unit_test") { output_dir = "${root_out_dir}/tests/standalone" + deps = [] + if (enable_sanitizer) { + if (!is_clang) { + deps += [ "//build/common/asan:package_asan_lib_for_ten_framework_standalone_test" ] + } + } + public_deps = [ "unit", "//core/src/ten_utils/backtrace",