| # Copyright 2017 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. |
| |
| # A template for an action that creates a Fuchsia Go test binary. |
| |
| import("//build/go/go_build.gni") |
| |
| template("go_test") { |
| is_disabled = defined(invoker.disabled) && invoker.disabled |
| go_build(target_name) { |
| test = true |
| with_test_spec = !is_disabled |
| forward_variables_from(invoker, "*", [ "environments" ]) |
| if (defined(invoker.environments)) { |
| test_environments = invoker.environments |
| } |
| } |
| } |