Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: refine asan lib location for testing #32

Merged
merged 2 commits into from
Sep 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading