| # Copyright 2020 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/bazel/bazel_test_suite.gni") | |
| import("//build/python/python_binary.gni") | |
| import("//build/python/python_library.gni") | |
| import("//build/testing/host_test_data.gni") | |
| assert(is_host, "python only supported in host toolchains") | |
| host_test_data("black") { | |
| sources = [ "//prebuilt/third_party/black/${host_platform}/black" ] | |
| } | |
| host_test_data("interpreter") { | |
| sources = [ | |
| "//prebuilt/third_party/python3/${host_platform}/lib", | |
| python_exe_src, | |
| ] | |
| } | |
| host_test_data("pip") { | |
| sources = [ | |
| "//prebuilt/third_party/python3/${host_platform}/lib", | |
| pip_exe_src, | |
| ] | |
| } | |
| bazel_test_suite("bazel_tests") { | |
| host_tests = [ "//build/python:host_tests" ] | |
| } | |
| # Python test scripts in subdirectories that have been migrated to Bazel-only | |
| # host_py_test() targets. Listing them here makes them subject to GN mypy | |
| # type checking as required by //build/shac.star. | |
| python_library("type_checked_scripts") { | |
| testonly = true | |
| visibility = [ ":*" ] | |
| sources = [ | |
| "tests/assembly/assembly_module_test.py", | |
| "tests/depfile/depfile_test.py", | |
| "tests/host_test/py_host_test_with_lib.py", | |
| "tests/serialization/serialization_test.py", | |
| ] | |
| library_deps = [ | |
| "//build/python/modules/assembly", | |
| "//build/python/modules/depfile", | |
| "//build/python/modules/serialization", | |
| "//build/python/tests/fast_copy_mock", | |
| "//build/python/tests/lib", | |
| ] | |
| } | |
| group("host_tests") { | |
| testonly = true | |
| deps = [ | |
| ":bazel_tests", | |
| ":type_checked_scripts", | |
| "tests/bin", | |
| "tests/lib", | |
| ] | |
| } | |
| python_binary("compress_lacewing_inputs") { | |
| main_source = "compress_lacewing_inputs.py" | |
| } | |
| python_binary("python_hermetic_concatenate") { | |
| enable_mypy = true | |
| main_source = "python_hermetic_concatenate.py" | |
| } | |
| python_binary("package_python_wheel") { | |
| enable_mypy = true | |
| main_source = "package_python_wheel.py" | |
| deps = [ "//build/python/modules/depfile" ] | |
| } | |
| group("tests") { | |
| testonly = true | |
| deps = [ | |
| ":host_tests", | |
| "tests/bin", | |
| "tests/lib", | |
| ] | |
| } |