Skip to content

Commit

Permalink
Re-enable the Java coverage tests.
Browse files Browse the repository at this point in the history
It has been disabled in bce8898 and in 21fb8ca and then was not re-enabled.

Also update src/java_tools/junitrunner/java/com/google/testing/coverage/BUILD to which I accidentally submitted a change directly to our OSS repository.

RELNOTES: None.
PiperOrigin-RevId: 153460778
  • Loading branch information
lberki authored and aehlig committed Apr 18, 2017
1 parent b6cc4c1 commit 3a5d3db
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,11 @@ genrule(
"if [[ $$(uname -a) =~ MSYS ]] || [[ $$(uname -a) =~ CYGWIN ]] || [[ $$(uname -a) =~ freebsd ]]; then",
" cp \"$(location :JacocoCoverage_deploy.jar)\" \"$@\";",
"else",
" \"$(JAVA)\" -jar \"$(location //third_party/java/jarjar:jarjar_bin_deploy.jar)\" process \"$(location :JacocoCoverage.jarjar)\" \"$(location :JacocoCoverage_deploy.jar)\" \"$@\"",
" \"$(JAVA)\" -jar \"$(location //third_party/java/jarjar:jarjar_command_deploy.jar)\" --rules \"$(location :JacocoCoverage.jarjar)\" --output \"$@\" \"$(location :JacocoCoverage_deploy.jar)\"",
"fi",
]),
tools = [
"//third_party/java/jarjar:jarjar_bin_deploy.jar",
"//third_party/java/jarjar:jarjar_command_deploy.jar",
"//tools/defaults:jdk",
],
)
13 changes: 11 additions & 2 deletions src/test/shell/bazel/bazel_coverage_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,18 @@ EOF

bazel coverage //:test &>$TEST_log || fail "Coverage for //:test failed"

echo ================ TL ======================
cat $TEST_log
echo ================ TL END ==================

ending_part=$(sed -n -e '/PASSED/,$p' $TEST_log)

echo ====== EP ======
echo "$ending_part"
echo ====== END EP ======

coverage_file_path=$(grep -Eo "/[/a-zA-Z0-9\.\_\-]+\.dat$" <<< "$ending_part")
echo ========= CFP "$coverage_file_path"
[ -e $coverage_file_path ] || fail "Coverage output file not exists!"

cat <<EOF > result.dat
Expand All @@ -107,5 +117,4 @@ EOF
fi
}

# TODO(#2227): Re-enable when the jacoco processor issue is fixed.
#run_suite "test tests"
run_suite "test tests"

0 comments on commit 3a5d3db

Please sign in to comment.