| # Copyright 2022 The Bazel Authors. All rights reserved. | |
| # | |
| # Licensed under the Apache License, Version 2.0 (the "License"); | |
| # you may not use this file except in compliance with the License. | |
| # You may obtain a copy of the License at | |
| # | |
| # http://www.apache.org/licenses/LICENSE-2.0 | |
| # | |
| # Unless required by applicable law or agreed to in writing, software | |
| # distributed under the License is distributed on an "AS IS" BASIS, | |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| # See the License for the specific language governing permissions and | |
| # limitations under the License. | |
| load("@bazel_skylib//rules:build_test.bzl", "build_test") | |
| load("@bazel_skylib//rules:diff_test.bzl", "diff_test") | |
| load("//python/private:bzlmod_enabled.bzl", "BZLMOD_ENABLED") # buildifier: disable=bzl-visibility | |
| load("//tests/support:py_reconfig.bzl", "py_reconfig_test") | |
| load(":defs.bzl", "define_toolchain_tests") | |
| define_toolchain_tests( | |
| name = "toolchain_tests", | |
| ) | |
| py_reconfig_test( | |
| name = "custom_platform_toolchain_test", | |
| srcs = ["custom_platform_toolchain_test.py"], | |
| config_settings = {"//tests/support:custom_runtime": "linux-x86-install-only-stripped"}, | |
| python_version = "3.13.1", | |
| target_compatible_with = [ | |
| "@platforms//os:linux", | |
| "@platforms//cpu:x86_64", | |
| ] if BZLMOD_ENABLED else ["@platforms//:incompatible"], | |
| ) | |
| build_test( | |
| name = "build_test", | |
| targets = [ | |
| "@python_3_14//:python_headers", | |
| ], | |
| ) | |
| # Verify that runtimes_manifest_workspace.bzl exactly matches runtimes_manifest.txt | |
| genrule( | |
| name = "gen_expected_runtimes_manifest_workspace", | |
| srcs = ["//python/private:runtimes_manifest.txt"], | |
| outs = ["expected_runtimes_manifest_workspace.bzl"], | |
| cmd = "$(execpath //python/private:sync_runtimes_manifest_workspace) $(location //python/private:runtimes_manifest.txt) $@", | |
| tools = ["//python/private:sync_runtimes_manifest_workspace"], | |
| ) | |
| diff_test( | |
| name = "runtimes_manifest_workspace_sync_test", | |
| file1 = "//python/private:runtimes_manifest_workspace.bzl", | |
| file2 = ":expected_runtimes_manifest_workspace.bzl", | |
| ) |