| # Copyright 2020 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("//sdk/cts/build/cts.gni") |
| |
| # TODO(omerlevran): Find a cleaner way to this by properly structuring the deps |
| # between the rules. Please try to avoid using this pattern. |
| _shared_out_dir = get_label_info(":bogus(${target_toolchain})", "root_out_dir") |
| |
| cts_dart_test("package_manager_test") { |
| sources = [ "package_manager_test.dart" ] |
| |
| deps = [ |
| "//sdk/cts/util/pkg:pkg", |
| "//sdk/cts/util/pm:pm", |
| "//sdk/testing/sl4f/client", |
| "//third_party/dart-pkg/pub/archive", |
| "//third_party/dart-pkg/pub/logging", |
| "//third_party/dart-pkg/pub/path", |
| "//third_party/dart-pkg/pub/quiver", |
| "//third_party/dart-pkg/pub/retry", |
| "//third_party/dart-pkg/pub/test", |
| ] |
| |
| non_dart_deps = [ ":runtime_deps($host_toolchain)" ] |
| args = [ "--data-dir=" + rebase_path(_shared_out_dir) ] |
| |
| # Runs on "main" builders (try and ci) in QEMU environments, but only on x64, |
| # as we don't currently support Dart on arm64 hosts. |
| environments = [] |
| if (is_host && target_cpu == "x64") { |
| environments = [ emu_env ] |
| } |
| } |
| |
| if (is_host) { |
| action("pm_test_package_gather_deps") { |
| metadata = { |
| package_barrier = [] |
| } |
| |
| testonly = true |
| |
| script = "//sdk/cts/build/scripts/gather_package_deps.py" |
| |
| outputs = [ "$target_gen_dir/pm_deps/package.tar" ] |
| |
| deps = [ |
| "components:cts-package-manager-sample-component($default_toolchain)", |
| ] |
| |
| args = [ |
| "--package_json_path", |
| rebase_path( |
| "$_shared_out_dir/obj/sdk/cts/tests/tools/package_manager/components/cts-package-manager-sample-component/package_manifest.json"), |
| "--meta_far_path", |
| rebase_path( |
| "$_shared_out_dir/obj/sdk/cts/tests/tools/package_manager/components/cts-package-manager-sample-component/meta.far"), |
| "--output_dir", |
| rebase_path("${target_gen_dir}/pm_deps"), |
| ] |
| } |
| |
| cts_host_test_data("runtime_deps") { |
| sources = [ |
| "$host_tools_dir/pm", |
| "$target_gen_dir/pm_deps/package.tar", |
| ] |
| outputs = [ "$target_gen_dir/runtime_deps/{{source_file_part}}" ] |
| deps = [ |
| ":pm_test_package_gather_deps($host_toolchain)", |
| "//src/sys/pkg/bin/pm:host($host_toolchain)", |
| ] |
| } |
| } |
| |
| group("tests") { |
| testonly = true |
| |
| deps = [ |
| ":package_manager_test($host_toolchain)", |
| "//garnet/packages/tools:sl4f", # Required to run tests locally. |
| ] |
| } |