mirror of
https://github.com/bazelbuild/bazel-skylib
synced 2024-11-26 04:30:24 +00:00
Fix a number of misc issues to allow google usage of bazel-skylib
1. Missing copyright header 2. Shell test fixes to use TEST_TMPDIR to have write access to directories 3. diff_test fix to use TEST_SRCDIR
This commit is contained in:
parent
f80abf6578
commit
51059a8157
|
@ -86,6 +86,9 @@ if [[ -d "${{RUNFILES_DIR:-/dev/null}}" && "${{RUNFILES_MANIFEST_ONLY:-}}" != 1
|
|||
elif [[ -f "${{RUNFILES_MANIFEST_FILE:-/dev/null}}" ]]; then
|
||||
RF1="$(grep -F -m1 "$F1 " "$RUNFILES_MANIFEST_FILE" | sed 's/^[^ ]* //')"
|
||||
RF2="$(grep -F -m1 "$F2 " "$RUNFILES_MANIFEST_FILE" | sed 's/^[^ ]* //')"
|
||||
elif [[ -f "$TEST_SRCDIR/$F1" && -f "$TEST_SRCDIR/$F2" ]]; then
|
||||
RF1="$TEST_SRCDIR/$F1"
|
||||
RF2="$TEST_SRCDIR/$F2"
|
||||
else
|
||||
echo >&2 "ERROR: could not find \"{file1}\" and \"{file2}\""
|
||||
exit 1
|
||||
|
|
|
@ -14,6 +14,7 @@ sh_test(
|
|||
"//tests:unittest.bash",
|
||||
],
|
||||
deps = ["@bazel_tools//tools/bash/runfiles"],
|
||||
tags = ["local"],
|
||||
)
|
||||
|
||||
diff_test(
|
||||
|
|
|
@ -202,4 +202,5 @@ function test_from_ext_repo_without_legacy_external_runfiles() {
|
|||
assert_from_ext_repo "--nolegacy_external_runfiles" "${FUNCNAME[0]}"
|
||||
}
|
||||
|
||||
cd "$TEST_TMPDIR"
|
||||
run_suite "diff_test_tests test suite"
|
||||
|
|
|
@ -1,3 +1,17 @@
|
|||
# Copyright 2019 The Bazel Authors. All rights reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
"""Unit tests for unittest.bzl."""
|
||||
|
||||
load("//lib:unittest.bzl", "analysistest", "asserts", "unittest")
|
||||
|
|
Loading…
Reference in a new issue