| # Copyright 2021 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/python/python_host_test.gni") |
| import("//build/testing/environments.gni") |
| |
| tests = [ |
| "args", |
| "buildenv", |
| "command", |
| "corpus", |
| "device", |
| "dictionary", |
| "factory", |
| "fuzzer", |
| "host", |
| "namespace", |
| ] |
| |
| if (is_host) { |
| common_test_sources = [ |
| "__init__.py", |
| "factory_fake.py", |
| "host_fake.py", |
| "process_fake.py", |
| "test_case.py", |
| "test_env.py", |
| ] |
| foreach(test, tests) { |
| _test_target = "${test}_test" |
| _test_dir = |
| "${root_out_dir}/test_data/" + get_label_info(_test_target, "dir") |
| |
| _data_target = "${_test_target}_data" |
| host_test_data(_data_target) { |
| sources = [ |
| "data/v1.fuzzers.json", |
| "data/v2.fuzzers.json", |
| ] |
| outputs = [ "${_test_dir}/data/{{source_file_part}}" ] |
| } |
| |
| python_host_test(_test_target) { |
| main_source = "${test}_test.py" |
| sources = common_test_sources |
| libraries = [ "../lib" ] |
| deps = [ ":${_data_target}" ] |
| test_dir = _test_dir |
| extra_args = [ "-v" ] |
| } |
| } |
| } |
| |
| group("tests") { |
| testonly = true |
| public_deps = [] |
| foreach(t, tests) { |
| public_deps += [ ":${t}_test($host_toolchain)" ] |
| } |
| } |
| |
| # This E2E test is intentionally disconnected from the build graph, as it |
| # requires fuzzers to have been built and deployed to a running device and thus |
| # is not currently suited to running in CQ. |
| if (is_host) { |
| python_host_test("e2e_test") { |
| main_source = "test_e2e.py" |
| sources = common_test_sources |
| libraries = [ "../lib" ] |
| extra_args = [ "-v" ] |
| environments = [ emu_env ] |
| } |
| } |
| |
| group("e2e_tests") { |
| testonly = true |
| public_deps = [ ":e2e_test($host_toolchain)" ] |
| } |