diff options
Diffstat (limited to 'tools/test')
-rw-r--r-- | tools/test/BUILD | 4 | ||||
-rw-r--r-- | tools/test/dummy_coverage_report_generator | 2 | ||||
-rwxr-xr-x | tools/test/test-setup.sh | 14 |
3 files changed, 9 insertions, 11 deletions
diff --git a/tools/test/BUILD b/tools/test/BUILD index 846016ba8b..97438edda6 100644 --- a/tools/test/BUILD +++ b/tools/test/BUILD @@ -9,12 +9,12 @@ filegroup( filegroup( name = "coverage_support", - srcs = [], + srcs = ["//tools/coverage:coverage_support"], ) filegroup( name = "coverage_report_generator", - srcs = ["dummy_coverage_report_generator"], + srcs = ["//tools/coverage:coverage_report_generator"], ) filegroup( diff --git a/tools/test/dummy_coverage_report_generator b/tools/test/dummy_coverage_report_generator deleted file mode 100644 index 27c43ad8c2..0000000000 --- a/tools/test/dummy_coverage_report_generator +++ /dev/null @@ -1,2 +0,0 @@ -# Dummy file. Bazel requires there to be a single file in the coverage report -# generator attribute, even though it's currently not used in Bazel. diff --git a/tools/test/test-setup.sh b/tools/test/test-setup.sh index c045f39144..14d7fd9a76 100755 --- a/tools/test/test-setup.sh +++ b/tools/test/test-setup.sh @@ -46,13 +46,12 @@ if [[ -n "${TEST_TOTAL_SHARDS+x}" ]] && ((TEST_TOTAL_SHARDS != 0)); then fi export GTEST_TMP_DIR="${TEST_TMPDIR}" -DIR="$TEST_SRCDIR" -RUNFILES_MANIFEST_FILE=$DIR/MANIFEST +RUNFILES_MANIFEST_FILE="${TEST_SRCDIR}/MANIFEST" if [ -z "$RUNFILES_MANIFEST_ONLY" ]; then function rlocation() { if [[ "$1" = /* ]]; then - echo $1 + echo "$1" else echo "$(dirname $RUNFILES_MANIFEST_FILE)/$1" fi @@ -60,7 +59,7 @@ if [ -z "$RUNFILES_MANIFEST_ONLY" ]; then else function rlocation() { if [[ "$1" = /* ]]; then - echo $1 + echo "$1" else echo $(grep "^$1 " $RUNFILES_MANIFEST_FILE | awk '{ print $2 }') fi @@ -70,11 +69,11 @@ fi export -f rlocation export RUNFILES_MANIFEST_FILE -if [ ! -z "$TEST_WORKSPACE" ] -then +DIR="$TEST_SRCDIR" +if [ ! -z "$TEST_WORKSPACE" ]; then DIR="$DIR"/"$TEST_WORKSPACE" fi - +[[ -n "$RUNTEST_PRESERVE_CWD" ]] && DIR="$PWD" # normal commands are run in the exec-root where they have access to @@ -100,6 +99,7 @@ if [[ "$TEST_NAME" = /* ]]; then else EXE="$(rlocation $TEST_WORKSPACE/$TEST_NAME)" fi +[[ -n "$RUNTEST_PRESERVE_CWD" ]] && EXE="${TEST_NAME}" exitCode=0 "${EXE}" "$@" || exitCode=$? |