Skip to content

Commit edba3a2

Browse files
committed
Add test
1 parent 2cf9957 commit edba3a2

File tree

4 files changed

+34
-2
lines changed

4 files changed

+34
-2
lines changed

tests/bootstrap_impls/BUILD.bazel

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
load("@rules_shell//shell:sh_test.bzl", "sh_test")
2-
31
# Copyright 2023 The Bazel Authors. All rights reserved.
42
#
53
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -13,6 +11,8 @@ load("@rules_shell//shell:sh_test.bzl", "sh_test")
1311
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1412
# See the License for the specific language governing permissions and
1513
# limitations under the License.
14+
load("@rules_pkg//pkg:tar.bzl", "pkg_tar")
15+
load("@rules_shell//shell:sh_test.bzl", "sh_test")
1616
load("//tests/support:py_reconfig.bzl", "py_reconfig_binary", "py_reconfig_test")
1717
load("//tests/support:sh_py_run_test.bzl", "sh_py_run_test")
1818
load("//tests/support:support.bzl", "SUPPORTS_BOOTSTRAP_SCRIPT")
@@ -158,4 +158,17 @@ py_reconfig_test(
158158
target_compatible_with = SUPPORTS_BOOTSTRAP_SCRIPT,
159159
)
160160

161+
pkg_tar(
162+
name = "external_binary",
163+
testonly = True,
164+
srcs = ["@other//:external_main"],
165+
include_runfiles = True,
166+
)
167+
168+
sh_test(
169+
name = "external_binary_test",
170+
srcs = ["external_binary_test.sh"],
171+
data = [":external_binary"],
172+
)
173+
161174
relative_path_test_suite(name = "relative_path_tests")
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
set -euxo pipefail
3+
4+
mkdir external_binary
5+
tar xf "tests/bootstrap_impls/external_binary.tar" -C external_binary
6+
test "$(external_binary/external_main)" = "token"

tests/modules/other/BUILD.bazel

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
load("@rules_python//tests/support:py_reconfig.bzl", "py_reconfig_binary")
2+
3+
package(
4+
default_visibility = ["//visibility:public"],
5+
)
6+
7+
py_reconfig_binary(
8+
name = "external_main",
9+
srcs = [":external_main.py"],
10+
bootstrap_impl = "system_python",
11+
main = "external_main.py",
12+
)

tests/modules/other/external_main.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
print("token")

0 commit comments

Comments
 (0)