| # Copyright 2018 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/board.gni") |
| |
| declare_args() { |
| # Whether to include tests that are known to fail on NUC with ASan. |
| # Should be set to false in the infra builders that have board == "x64" and |
| # "asan" in variants. |
| include_tests_that_fail_on_nuc_asan = true |
| |
| # The list of environment names to include in "basic_envs". |
| basic_env_names = [] |
| } |
| |
| _all_named_envs = [] |
| |
| ### Individual test environments ### |
| |
| emu_env = { |
| dimensions = { |
| # May actually run on QEMU and / or FEMU. |
| device_type = "QEMU" |
| } |
| } |
| _all_named_envs += [ |
| { |
| name = "emu" |
| env = emu_env |
| }, |
| ] |
| |
| astro_env = { |
| dimensions = { |
| device_type = "Astro" |
| } |
| } |
| _all_named_envs += [ |
| { |
| name = "astro" |
| env = astro_env |
| }, |
| ] |
| |
| sherlock_env = { |
| dimensions = { |
| device_type = "Sherlock" |
| } |
| } |
| _all_named_envs += [ |
| { |
| name = "sherlock" |
| env = sherlock_env |
| }, |
| ] |
| |
| nelson_env = { |
| dimensions = { |
| device_type = "Nelson" |
| } |
| } |
| _all_named_envs += [ |
| { |
| name = "nelson" |
| env = nelson_env |
| }, |
| ] |
| |
| nuc_env = { |
| dimensions = { |
| device_type = "Intel NUC Kit NUC7i5DNHE" |
| } |
| } |
| _all_named_envs += [ |
| { |
| name = "nuc" |
| env = nuc_env |
| }, |
| ] |
| |
| linux_env = { |
| dimensions = { |
| os = "Linux" |
| cpu = current_cpu |
| } |
| } |
| _all_named_envs += [ |
| { |
| name = "linux" |
| env = linux_env |
| }, |
| ] |
| |
| mac_env = { |
| dimensions = { |
| os = "Mac" |
| cpu = current_cpu |
| } |
| |
| # When running tests for a mac build, we only wish to run mac tests; we attach |
| # the "mac" tag in that case to filter out other tests. |
| tags = [ "mac" ] |
| } |
| _all_named_envs += [ |
| { |
| name = "mac" |
| env = mac_env |
| }, |
| ] |
| |
| if (host_os == "linux") { |
| host_env = linux_env |
| } else if (host_os == "mac") { |
| host_env = mac_env |
| } |
| |
| ### Select environment lists ### |
| |
| # Tests that fail on a NUC in ASan but otherwise want to run on a NUC should |
| # use this. |
| nuc_env_fails_on_asan = [] |
| if (include_tests_that_fail_on_nuc_asan) { |
| nuc_env_fails_on_asan += [ nuc_env ] |
| } |
| |
| basic_envs = [] |
| |
| # TODO(49414): Change default value of basic_env_names to "emu" |
| # and get rid of this if statement. |
| if (basic_env_names == []) { |
| if (board_name == "x64") { |
| basic_envs = [ |
| emu_env, |
| nuc_env, |
| ] |
| } else if (board_name == "qemu-arm64" || board_name == "qemu-x64") { |
| basic_envs = [ emu_env ] |
| } |
| } else { |
| foreach(name, basic_env_names) { |
| foreach(named_env, _all_named_envs) { |
| if (name == named_env.name) { |
| basic_envs += [ named_env.env ] |
| } |
| } |
| } |
| } |