| # Copyright 2023 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_binary.gni") |
| import("//build/python/python_library.gni") |
| import("//build/testing/host_test_data.gni") |
| |
| if (is_host) { |
| python_library("mobly_driver") { |
| library_name = "mobly_driver" |
| source_root = "//src/testing/end_to_end/mobly_driver/mobly_driver" |
| enable_mypy = true |
| sources = [ |
| "__init__.py", |
| "api/__init__.py", |
| "api/api_ffx.py", |
| "api/api_infra.py", |
| "api/api_mobly.py", |
| "driver/__init__.py", |
| "driver/base.py", |
| "driver/common.py", |
| "driver/infra.py", |
| "driver/local.py", |
| "driver_factory.py", |
| ] |
| library_deps = [ "//third_party/mobly:mobly_no_testonly" ] |
| } |
| |
| # Mobly Driver Python binary definition. |
| _md_bin_target = "mobly_driver_binary_target" |
| _md_bin_name = "mobly_driver.pyz" |
| python_binary(_md_bin_target) { |
| testonly = true |
| enable_mypy = true |
| main_source = "main.py" |
| sources = [ "main.py" ] |
| main_callable = "main" |
| output_name = _md_bin_name |
| |
| deps = [ ":mobly_driver" ] |
| } |
| |
| # Mobly Driver test data definition. |
| # This enables the Python binary to be used as a host test data dependency. |
| host_test_data("mobly_driver_test_data_target") { |
| testonly = true |
| sources = [ "${target_out_dir}/${_md_bin_name}" ] |
| outputs = [ "${target_out_dir}/test_data/${_md_bin_name}" ] |
| deps = [ ":${_md_bin_target}" ] |
| } |
| } |
| |
| group("tests") { |
| testonly = true |
| public_deps = [ |
| "tests/functional_tests:tests", |
| "tests/unit_tests:tests", |
| ] |
| } |