Skip to content

Commit

Permalink
Add a copy of bashunit.
Browse files Browse the repository at this point in the history
Needed for tests of android_sdk_repository.

Part of #76.

PiperOrigin-RevId: 557560436
Change-Id: I1c904b2e3a3136819b3d6b3bc6ee49193aeebbce
  • Loading branch information
katre authored and copybara-github committed Aug 16, 2023
1 parent a764568 commit e844f65
Show file tree
Hide file tree
Showing 4 changed files with 1,807 additions and 0 deletions.
43 changes: 43 additions & 0 deletions test/bashunit/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
load("@rules_python//python:py_test.bzl", "py_test")

package(
default_applicable_licenses = ["//:license"],
default_visibility = [
"//test:__subpackages__",
],
)

licenses(["notice"])

exports_files(
["unittest.bash"],
)

sh_library(
name = "bashunit",
testonly = True,
srcs = [
"unittest.bash",
"unittest_utils.sh",
],
)

# Test bashunit with python to avoid recursion.
py_test(
name = "bashunit_test",
size = "medium",
srcs = ["unittest_test.py"],
data = [
":bashunit",
# This test relies on writing shell scripts that use bash runfiles
# to load the actual copy of unittest.bash being tested.
"@bazel_tools//tools/bash/runfiles",
],
main = "unittest_test.py",
python_version = "PY3",
srcs_version = "PY3",
tags = [
"manual", # TODO(b/266084774): Re-enable this.
"no_windows", # test runs bash scripts in a subprocess
],
)
Loading

0 comments on commit e844f65

Please sign in to comment.