Skip to content

Commit 51b8c4f

Browse files
committed
Improve grep command to detect fuzzer functions more precisely.
1 parent 7e0c613 commit 51b8c4f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

infra/base-images/base-builder/compile_native_go_fuzzer

+3-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
#
1616
################################################################################
1717

18+
set -x
19+
1820
function build_native_go_fuzzer() {
1921
fuzzer=$1
2022
function=$2
@@ -52,7 +54,7 @@ abs_file_dir=$(go list $tags -f {{.Dir}} $path)
5254
fuzzer_filename=$(grep -r -l --include='*.go' -s "$function" "${abs_file_dir}")
5355

5456
# Test if file contains a line with "func $function" and "testing.F".
55-
if [ $(grep -r "func $function" $fuzzer_filename | grep "testing.F" | wc -l) -eq 1 ]
57+
if [ $(grep -r "func $function(" $fuzzer_filename | grep "testing.F" | wc -l) -eq 1 ]
5658
then
5759
build_native_go_fuzzer $fuzzer $function $abs_file_dir
5860
else

0 commit comments

Comments
 (0)