| # Copyright 2026 The Fuchsia Authors. All rights reserved. | |
| # Use of this source code is governed by a BSD-style license that can be | |
| # found in the LICENSE file. | |
| import("//build/components.gni") | |
| import("//build/rust/rustc_library.gni") | |
| import("//build/rust/rustc_test.gni") | |
| rustc_library("kstring") { | |
| with_unit_tests = true | |
| edition = "2024" | |
| sources = [ | |
| "src/interned_category.rs", | |
| "src/interned_string.rs", | |
| "src/lib.rs", | |
| ] | |
| deps = [ "macro:kstring-macro" ] | |
| } | |
| fuchsia_unittest_package("kstring-test") { | |
| deps = [ ":kstring_test" ] | |
| test_specs = { | |
| environments = [ emu_env ] | |
| } | |
| } | |
| source_set("cpp_test_lib") { | |
| testonly = true | |
| sources = [ "tests/cpp_interned.cc" ] | |
| public_deps = [ "//src/performance/lib/fxt" ] | |
| } | |
| rustc_test("kstring_cpp_integration_test") { | |
| edition = "2024" | |
| source_root = "tests/integration_test.rs" | |
| sources = [ "tests/integration_test.rs" ] | |
| deps = [ | |
| ":cpp_test_lib", | |
| ":kstring", | |
| ] | |
| configs += [ "//build/config/fuchsia:dynamic_cpp_standard_library" ] | |
| } | |
| fuchsia_unittest_package("kstring-cpp-integration-test") { | |
| deps = [ ":kstring_cpp_integration_test" ] | |
| test_specs = { | |
| environments = [ emu_env ] | |
| } | |
| } | |
| group("tests") { | |
| testonly = true | |
| deps = [ | |
| ":kstring-cpp-integration-test", | |
| ":kstring-test", | |
| ":kstring_test($host_toolchain)", | |
| ] | |
| } |