2021-11-11 13:54:42 +00:00
|
|
|
"tests for libs"
|
|
|
|
|
|
|
|
load("@bazel_skylib//rules:write_file.bzl", "write_file")
|
|
|
|
load("//lib:expand_make_vars.bzl", "expand_template")
|
2021-11-08 15:22:47 +00:00
|
|
|
load(":expand_make_vars_test.bzl", "expand_make_vars_test_suite")
|
2021-11-09 23:13:30 +00:00
|
|
|
load(":utils_test.bzl", "utils_test_suite")
|
|
|
|
load(":paths_test.bzl", "paths_test_suite")
|
2021-11-08 15:22:47 +00:00
|
|
|
|
2021-11-09 23:13:30 +00:00
|
|
|
expand_make_vars_test_suite()
|
|
|
|
|
|
|
|
paths_test_suite()
|
|
|
|
|
|
|
|
utils_test_suite()
|
2021-11-11 13:54:42 +00:00
|
|
|
|
|
|
|
write_file(
|
|
|
|
name = "gen_template",
|
|
|
|
out = "template.txt",
|
|
|
|
content = [
|
|
|
|
"#!/bin/bash",
|
|
|
|
"set -o errexit",
|
|
|
|
"""[ "{thing}" == "stuff" ]""",
|
|
|
|
"""[ "%path%" == "BINDIR/lib/tests/template.txt" ]""",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
expand_template(
|
|
|
|
name = "expand_template",
|
|
|
|
out = "expand_template_test.sh",
|
|
|
|
data = [":gen_template"],
|
|
|
|
is_executable = True,
|
|
|
|
substitutions = {
|
|
|
|
"{thing}": "stuff",
|
|
|
|
"%path%": "$(execpath :gen_template)",
|
|
|
|
"BINDIR": "$(BINDIR)",
|
|
|
|
},
|
|
|
|
template = "template.txt",
|
|
|
|
)
|
|
|
|
|
|
|
|
sh_test(
|
|
|
|
name = "expand_template_test",
|
|
|
|
srcs = ["expand_template"],
|
|
|
|
)
|