Skip to content

Commit

Permalink
Fix shell tests that uses junit and hamcrest jars
Browse files Browse the repository at this point in the history
  • Loading branch information
meteorcloudy committed Mar 22, 2023
1 parent a53855c commit 4894d27
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
16 changes: 16 additions & 0 deletions src/test/shell/bazel/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ filegroup(
name = "test-deps-wo-bazel",
testonly = 1,
srcs = [
":junit_jar",
":hamcrest_jar",
"cc_api_rules.bzl",
"remote_helpers.sh",
"testing_server.py",
Expand All @@ -73,6 +75,20 @@ filegroup(
],
)

genrule(
name = "junit_jar",
srcs = ["@maven//:junit_junit_file"],
outs = ["junit.jar"],
cmd = "cp $< $@",
)

genrule(
name = "hamcrest_jar",
srcs = ["@maven//:org_hamcrest_hamcrest_core_file"],
outs = ["hamcrest.jar"],
cmd = "cp $< $@",
)

sh_test(
name = "bazel_symlink_test",
size = "medium",
Expand Down
8 changes: 4 additions & 4 deletions src/test/shell/testenv.sh.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,11 @@ protoc_compiler="${BAZEL_RUNFILES}/src/test/shell/integration/protoc"
skylib_package="@bazel_skylib//"

if [ -z ${RUNFILES_MANIFEST_ONLY+x} ]; then
junit_jar="${BAZEL_RUNFILES}/third_party/junit/junit-*.jar"
hamcrest_jar="${BAZEL_RUNFILES}/third_party/hamcrest/hamcrest-*.jar"
junit_jar="${BAZEL_RUNFILES}/src/test/shell/bazel/junit.jar"
hamcrest_jar="${BAZEL_RUNFILES}/src/test/shell/bazel/hamcrest.jar"
else
junit_jar=$(rlocation io_bazel/third_party/junit/junit-.*.jar)
hamcrest_jar=$(rlocation io_bazel/third_party/hamcrest/hamcrest-.*.jar)
junit_jar=$(rlocation io_bazel/src/test/shell/bazel/junit.jar)
hamcrest_jar=$(rlocation io_bazel/src/test/shell/bazel/hamcrest.jar)
fi


Expand Down

0 comments on commit 4894d27

Please sign in to comment.