| # Copyright 2016 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_package.gni") |
| |
| # Defines a Dart test suite |
| # |
| # Parameters |
| # |
| # source_dir (optional) |
| # Directory containing the test sources. Defaults to "test". |
| # |
| # deps (optional) |
| # List of labels for Dart packages this package depends on. |
| # |
| # analysis_options (optional) |
| # By default, a script to run the analyzer on the contents of the package is |
| # generated in the output directory. This parameter contains the path to an |
| # analysis options file for this target. |
| # |
| # disable_analysis (optional) |
| # Prevents the analysis script from being generated. |
| # |
| # Example of usage: |
| # |
| # dart_test("baz_test") { |
| # source_dir = "." |
| # deps = [ |
| # "//foo/baz", |
| # "//third_party/dart-pkg/pub/test", |
| # ] |
| # } |
| template("dart_test") { |
| |
| template_name = target_name |
| |
| dart_package(template_name) { |
| forward_variables_from(invoker, [ |
| "analysis_options", |
| "deps", |
| "disable_analysis", |
| ]) |
| |
| infer_package_name = true |
| |
| source_dir = "test" |
| if (defined(invoker.source_dir)) { |
| source_dir = invoker.source_dir |
| } |
| } |
| } |