From 22afda8b9ebcabca6a8e9932cc714d7cba38021c Mon Sep 17 00:00:00 2001 From: Mike Aizatsky Date: Thu, 20 Oct 2016 14:13:36 -0700 Subject: [PATCH] [infra] fail test if there are zero fuzzers --- infra/base-images/base-libfuzzer/test | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/infra/base-images/base-libfuzzer/test b/infra/base-images/base-libfuzzer/test index bd66b39e2..5466eb7db 100755 --- a/infra/base-images/base-libfuzzer/test +++ b/infra/base-images/base-libfuzzer/test @@ -1,4 +1,4 @@ -#!/bin/bash -eux +#!/bin/bash -eu # Copyright 2016 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -18,7 +18,20 @@ # Test fuzzers compile -for FUZZER in $(find /out -executable -type f); do + +DIR="/out" +N=0 +for FUZZER in $(find $DIR -executable -type f); do + echo "testing $FUZZER" $FUZZER -runs=32 + N=$[$N+1] done +if [ "$N" -eq "0" ]; then + echo "ERROR: no fuzzers found in $DIR" + ls -al /out + exit 1 +fi + +echo "$N fuzzers total" +