Use bazel generic script for opencensus (#5700)

This commit is contained in:
Catena cyber 2021-05-03 00:56:02 +02:00 committed by GitHub
parent 98f5a82bdb
commit a9fc96e56d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 15 deletions

View File

@ -19,18 +19,4 @@ git grep cc_fuzz_target.bzl | grep BUILD | cut -d: -f1 | uniq | while read i; do
git grep fuzz_target\( | grep BUILD | cut -d: -f1 | uniq | while read i; do sed -i -e 's/fuzz_target/fuzz_test/' $i; done
declare -r QUERY='
let all_fuzz_tests = attr(tags, "fuzz-test", "//...") in
$all_fuzz_tests - attr(tags, "no-oss-fuzz", $all_fuzz_tests)
'
declare -r PACKAGE_SUFFIX="_oss_fuzz"
declare -r OSS_FUZZ_TESTS="$(bazel query "${QUERY}" | sed "s/$/${PACKAGE_SUFFIX}/")"
bazel build -c opt --config=oss-fuzz --linkopt=-lc++ \
--action_env=CC="${CC}" --action_env=CXX="${CXX}" \
${OSS_FUZZ_TESTS[*]}
for oss_fuzz_archive in $(find bazel-bin/ -name "*${PACKAGE_SUFFIX}.tar"); do
tar -xvf "${oss_fuzz_archive}" -C "${OUT}"
done
bazel_build_fuzz_tests