aboutsummaryrefslogtreecommitdiffhomepage
path: root/projects
diff options
context:
space:
mode:
authorGravatar Catena cyber <35799796+catenacyber@users.noreply.github.com>2022-07-07 17:00:39 +0200
committerGravatar GitHub <noreply@github.com>2022-07-07 17:00:39 +0200
commit74762513ad565f46a4502f390cb0cb64bc9bdf21 (patch)
tree9e276b0049543ad9e604af4147a5c9c22471359e /projects
parent02659954bea618ae269bb9d554e2283f94650cf8 (diff)
infra: have timeout per fuzz target for coverage (#7831)
* infra: have timeout per fuzz target for coverage As is done for other languages * ngolo-fuzzing: remove temporary workaround now that https://github.com/golang/go/issues/53190 is closed * ngolo-fuzzing: use built go toolchain in its directory without copying it to /root/.go/ in order to get coverage for std lib in the end * infra: ability to get coverage for additional golang package And uses it with ngolo-fuzzing : ngolo-fuzzing fuzz targets live in a different repository than the code being fuzzed, and we we want to get the coverage, for both the fuzz target and the package being fuzzed * fixup bash unbound * fixup ngolo-fuzzing only match at beginning for std package * stricter check for every additional go package
Diffstat (limited to 'projects')
-rwxr-xr-xprojects/ngolo-fuzzing/build.sh13
1 files changed, 4 insertions, 9 deletions
diff --git a/projects/ngolo-fuzzing/build.sh b/projects/ngolo-fuzzing/build.sh
index e2abec43..7c06d1f0 100755
--- a/projects/ngolo-fuzzing/build.sh
+++ b/projects/ngolo-fuzzing/build.sh
@@ -18,15 +18,10 @@
# compile latest go from git
(
cd $SRC/goroot/src
-(
-# temporary workaround for https://github.com/golang/go/issues/53190
-cd runtime
-grep nosplit libfuzzer.go || sed -i 's/func libfuzzerTraceConstCmp/\n\/\/go:nosplit\nfunc libfuzzerTraceConstCmp/' libfuzzer.go
-)
./make.bash
)
rm -Rf /root/.go/
-mv $SRC/goroot /root/.go
+export PATH=$PATH:$SRC/goroot/bin/
compile_package () {
pkg=$1
@@ -53,7 +48,7 @@ compile_package () {
continue
fi
cd fuzz_ng_$pkg_flat
- compile_go_fuzzer . FuzzNG_unsure fuzz_ngo_$pkg_flat
+ GO_COV_ADD_PKG="$pkg" compile_go_fuzzer . FuzzNG_unsure fuzz_ngo_$pkg_flat
)
else
(
@@ -75,8 +70,8 @@ go build
)
# maybe we should git clone --depth 1 https://github.com/golang/go.git
-find /root/.go/src/ -type d | cut -d/ -f5- | while read pkg; do
- if [[ `ls /root/.go/src/$pkg/*.go | wc -l` == '0' ]]; then
+find $SRC/goroot/src/ -type d | cut -d/ -f5- | while read pkg; do
+ if [[ `ls $SRC/goroot/src/$pkg/*.go | wc -l` == '0' ]]; then
continue
fi
if [[ `echo $pkg | grep internal | wc -l` == '1' ]]; then