2
0
Fork 0
mirror of https://github.com/bazelbuild/bazel-skylib synced 2024-11-28 08:43:51 +00:00
bazel-skylib/tests/BUILD
Fabian Meumertzheim 8386b9d32b
Expose int- and string-valued build settings as Make variables (#440)
While build settings allow for much cleaner flag and setting definitions
than `--define`, they have the major drawback that rules need to provide
dedicated support for them, which isn't the case for native and most
community-maintained rules.

This change attempts to bridge this gap by optionally exposing the value
of the common build setting types as Make variables to rules that depend
on them via the `toolchains` attribute: If the new `make_variable`
attribute is set, the value of the flag or setting is available as a
Make variable with that.

Consistency with pre-defined Make variables is enforced by limiting the
character set for `make_variable` values to `[A-Z0-9_]`. The new
attribute is also only added to int- and string-valued build settings as
the other types lack a canonical stringification.

Co-authored-by: Xùdōng Yáng <wyverald@gmail.com>
2023-08-22 19:41:36 +00:00

106 lines
2.3 KiB
Python

load("//:bzl_library.bzl", "bzl_library")
load(":build_test_tests.bzl", "build_test_test_suite")
load(":collections_tests.bzl", "collections_test_suite")
load(":common_settings_tests.bzl", "common_settings_test_suite")
load(":dicts_tests.bzl", "dicts_test_suite")
load(":new_sets_tests.bzl", "new_sets_test_suite")
load(":partial_tests.bzl", "partial_test_suite")
load(":paths_tests.bzl", "paths_test_suite")
load(":selects_tests.bzl", "selects_test_suite")
load(":shell_tests.bzl", "shell_args_test_gen", "shell_test_suite")
load(":structs_tests.bzl", "structs_test_suite")
load(":subpackages_tests.bzl", "subpackages_test_suite")
load(":types_tests.bzl", "types_test_suite")
load(":unittest_tests.bzl", "unittest_passing_tests_suite")
load(":versions_tests.bzl", "versions_test_suite")
licenses(["notice"])
exports_files(
["unittest.bash"],
visibility = ["//tests:__subpackages__"],
)
build_test_test_suite()
collections_test_suite()
common_settings_test_suite()
dicts_test_suite()
new_sets_test_suite()
partial_test_suite()
paths_test_suite()
selects_test_suite()
shell_test_suite()
structs_test_suite()
subpackages_test_suite()
types_test_suite()
unittest_passing_tests_suite()
versions_test_suite()
bzl_library(
name = "unittest_tests_bzl",
srcs = ["unittest_tests.bzl"],
visibility = ["//visibility:private"],
deps = ["//lib:unittest"],
)
sh_test(
name = "unittest_e2e_test",
srcs = ["unittest_test.sh"],
data = [
":unittest.bash",
":unittest_tests_bzl",
"//lib:dicts",
"//lib:new_sets",
"//lib:sets",
"//lib:types",
"//lib:unittest",
"//toolchains/unittest:test_deps",
"@bazel_tools//tools/bash/runfiles",
],
tags = ["local"],
)
sh_test(
name = "analysis_test_e2e_test",
srcs = ["analysis_test_test.sh"],
data = [
":unittest.bash",
"//rules:analysis_test.bzl",
"@bazel_tools//tools/bash/runfiles",
],
tags = ["local"],
)
sh_test(
name = "common_settings_e2e_test",
srcs = ["common_settings_test.sh"],
data = [
":unittest.bash",
"//rules:common_settings.bzl",
"@bazel_tools//tools/bash/runfiles",
],
tags = ["local"],
)
shell_args_test_gen(
name = "shell_spawn_e2e_test_src",
)
sh_test(
name = "shell_spawn_e2e_test",
srcs = [":shell_spawn_e2e_test_src"],
)