Skip to content

Commit

Permalink
fix: refine asan lib location for testing (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
halajohn authored Sep 21, 2024
1 parent da488e8 commit b68f02b
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 12 deletions.
10 changes: 0 additions & 10 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -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" ]
}
}
}
4 changes: 2 additions & 2 deletions build/common/asan/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
6 changes: 6 additions & 0 deletions tests/ten_runtime/smoke/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
7 changes: 7 additions & 0 deletions tests/ten_runtime/unit/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
7 changes: 7 additions & 0 deletions tests/ten_utils/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit b68f02b

Please sign in to comment.