xref: /aosp_15_r20/external/bazelbuild-rules_android/test/bashunit/BUILD (revision 9e965d6fece27a77de5377433c2f7e6999b8cc0b)
1load("@rules_python//python:py_test.bzl", "py_test")
2
3package(
4    default_applicable_licenses = ["//:license"],
5    default_visibility = [
6        "//test:__subpackages__",
7    ],
8)
9
10licenses(["notice"])
11
12exports_files(
13    ["unittest.bash"],
14)
15
16sh_library(
17    name = "bashunit",
18    testonly = True,
19    srcs = [
20        "unittest.bash",
21        "unittest_utils.sh",
22    ],
23)
24
25# Test bashunit with python to avoid recursion.
26py_test(
27    name = "bashunit_test",
28    size = "medium",
29    srcs = ["unittest_test.py"],
30    data = [
31        ":bashunit",
32        # This test relies on writing shell scripts that use bash runfiles
33        # to load the actual copy of unittest.bash being tested.
34        "@bazel_tools//tools/bash/runfiles",
35    ],
36    main = "unittest_test.py",
37    python_version = "PY3",
38    srcs_version = "PY3",
39    tags = [
40        "manual",  # TODO(b/266084774): Re-enable this.
41        "no_windows",  # test runs bash scripts in a subprocess
42    ],
43)
44