| # 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("//build/components.gni") |
| import("//build/dart/dart_component.gni") |
| import("//build/dart/dart_library.gni") |
| import("//build/dart/dart_test_component.gni") |
| |
| group("dart") { |
| deps = [ ":inspect_dart_codelab" ] |
| } |
| |
| part_ids = [ |
| 1, |
| 2, |
| 3, |
| 4, |
| 5, |
| ] |
| integration_test_components = [] |
| part_components = [] |
| unit_test_components = [] |
| |
| foreach(part_id, part_ids) { |
| part = "part_" + part_id |
| component_name = part + "_unit_tests" |
| unit_test_target = component_name + "_component" |
| unit_test_components += [ ":" + unit_test_target ] |
| |
| dart_test_component(unit_test_target) { |
| component_name = component_name |
| package_root = part |
| sources = [ "reverser_test.dart" ] |
| |
| deps = [ |
| part + ":lib", |
| "//sdk/dart/fuchsia_inspect", |
| "//sdk/dart/fuchsia_logger", |
| "//third_party/dart-pkg/pub/test", |
| ] |
| } |
| |
| part_components += [ "//examples/diagnostics/inspect/codelab/dart/" + part ] |
| integration_test_target = part + "_integration_tests_component" |
| integration_test_components += [ ":" + integration_test_target ] |
| |
| dart_test_component(integration_test_target) { |
| component_name = part + "_integration_tests" |
| package_root = part |
| manifest = part + "/meta/integration_tests.cml" |
| sources = [ "integration_test.dart" ] |
| |
| deps = [ |
| "//examples/diagnostics/inspect/codelab/dart/testing", |
| "//sdk/dart/fuchsia_logger", |
| "//third_party/dart-pkg/pub/test", |
| ] |
| } |
| } |
| |
| fuchsia_package("inspect_dart_codelab") { |
| deps = [ |
| "//examples/diagnostics/inspect/codelab/dart/client", |
| "//examples/diagnostics/inspect/codelab/dart/fizzbuzz", |
| ] + part_components |
| } |
| |
| fuchsia_test_package("inspect_dart_codelab_unit_tests") { |
| test_components = unit_test_components |
| } |
| |
| fuchsia_test_package("inspect_dart_codelab_integration_tests") { |
| test_components = integration_test_components |
| deps = [ "//examples/diagnostics/inspect/codelab/dart/fizzbuzz" ] + |
| part_components |
| } |
| |
| group("tests") { |
| testonly = true |
| |
| deps = [ |
| # TODO(fxbug.dev/103146): bring all components inside the test packages. |
| ":inspect_dart_codelab_integration_tests", |
| ":inspect_dart_codelab_unit_tests", |
| ] |
| } |