|  | # Copyright 2019 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/dart/dart_tool.gni") | 
|  | import("//build/dart/test.gni") | 
|  | import("//build/testing/host_test_data.gni") | 
|  |  | 
|  | group("tests") { | 
|  | testonly = true | 
|  |  | 
|  | deps = [ | 
|  | ":fxtest_tests($host_toolchain)", | 
|  | ":test_runner_test($host_toolchain)", | 
|  | ] | 
|  | } | 
|  |  | 
|  | ## Production code | 
|  |  | 
|  | # Main executable target. | 
|  | dart_tool("fxtest") { | 
|  | package_name = "fxtest" | 
|  | main_dart = "bin/main.dart" | 
|  |  | 
|  | deps = [ ":fxtest_lib" ] | 
|  | } | 
|  |  | 
|  | # Library containing all production (non-test) code. | 
|  | # | 
|  | # Using a separate library lets us avoid using the implicit dart_library | 
|  | # generated by dart_tool. Until dart_tool formally makes the generated | 
|  | # dart_library part of its documented contract, using this explicit library | 
|  | # prevents unexpected changes in dart_tool. | 
|  | # | 
|  | # Using dart_library separately also keeps sources_required on, which helps | 
|  | # to prevent Dart files being added to the tree but not to sources. | 
|  | dart_library("fxtest_lib") { | 
|  | package_name = "fxtest" | 
|  |  | 
|  | sources = [ | 
|  | "analytics_reporter.dart", | 
|  | "arg_parser.dart", | 
|  | "checklist.dart", | 
|  | "cmd.dart", | 
|  | "cmd_cli.dart", | 
|  | "command_tokens.dart", | 
|  | "constants.dart", | 
|  | "exceptions.dart", | 
|  | "execution_handle.dart", | 
|  | "exit_code.dart", | 
|  | "fxtest.dart", | 
|  | "matching/comparer.dart", | 
|  | "matching/comparison_result.dart", | 
|  | "matching/matching.dart", | 
|  | "matching/single_test_matcher.dart", | 
|  | "matching/test_attribute_matching.dart", | 
|  | "output/output.dart", | 
|  | "output/output_buffer.dart", | 
|  | "output/output_formatter.dart", | 
|  | "package_repository.dart", | 
|  | "package_url.dart", | 
|  | "rebuilder.dart", | 
|  | "test_arguments.dart", | 
|  | "test_bundle.dart", | 
|  | "test_definition.dart", | 
|  | "test_event.dart", | 
|  | "test_names_collector.dart", | 
|  | "test_runner.dart", | 
|  | "tests_config.dart", | 
|  | "tests_manifest_reader.dart", | 
|  | "utils.dart", | 
|  | ] | 
|  |  | 
|  | deps = [ | 
|  | "//scripts/fxutils", | 
|  | "//third_party/dart-pkg/pub/args", | 
|  | "//third_party/dart-pkg/pub/async", | 
|  | "//third_party/dart-pkg/pub/edit_distance", | 
|  | "//third_party/dart-pkg/pub/io", | 
|  | "//third_party/dart-pkg/pub/meta", | 
|  | "//third_party/dart-pkg/pub/path", | 
|  | "//third_party/dart-pkg/pub/pedantic", | 
|  | ] | 
|  | } | 
|  |  | 
|  | ## Tests | 
|  |  | 
|  | dart_test("test_runner_test") { | 
|  | sources = [ "test_runner_test.dart" ] | 
|  |  | 
|  | deps = [ | 
|  | ":fxtest_lib", | 
|  | "//scripts/fxutils", | 
|  | "//third_party/dart-pkg/pub/pedantic", | 
|  | "//third_party/dart-pkg/pub/test", | 
|  | ] | 
|  | } | 
|  |  | 
|  | dart_test("fxtest_tests") { | 
|  | sources = [ | 
|  | "args_test.dart", | 
|  | "helper_test.dart", | 
|  | "output_formatter_test.dart", | 
|  | "output_test.dart", | 
|  | "package_repository_test.dart", | 
|  | "parsing_test.dart", | 
|  | "process_output_test.dart", | 
|  | "setup_test.dart", | 
|  | "test_bundle_test.dart", | 
|  | "utils_test.dart", | 
|  | ] | 
|  |  | 
|  | deps = [ | 
|  | ":fxtest_lib", | 
|  | "//scripts/fxutils", | 
|  | "//third_party/dart-pkg/pub/args", | 
|  | "//third_party/dart-pkg/pub/async", | 
|  | "//third_party/dart-pkg/pub/io", | 
|  | "//third_party/dart-pkg/pub/meta", | 
|  | "//third_party/dart-pkg/pub/mockito", | 
|  | "//third_party/dart-pkg/pub/test", | 
|  | ] | 
|  | } |