소스 검색

Support running checked in failcases, seed it with two found locally.

Thomas Van Lenten 5 년 전
부모
커밋
760a931ae5
3개의 변경된 파일18개의 추가작업 그리고 0개의 파일을 삭제
  1. 1 0
      FuzzTesting/FailCases/TextFormat-ending-minus
  2. 1 0
      FuzzTesting/FailCases/TextFormat-ending-zero
  3. 16 0
      FuzzTesting/do_build.sh

+ 1 - 0
FuzzTesting/FailCases/TextFormat-ending-minus

@@ -0,0 +1 @@
+  	1:0  	1:0 	 	5:-

+ 1 - 0
FuzzTesting/FailCases/TextFormat-ending-zero

@@ -0,0 +1 @@
+  	1:0  	1:0 	 	1:0

+ 16 - 0
FuzzTesting/do_build.sh

@@ -6,6 +6,8 @@ readonly FuzzTestingDir=$(dirname "$(echo $0 | sed -e "s,^\([^/]\),$(pwd)/\1,")"
 
 cd "${FuzzTestingDir}"
 
+FUZZ_TESTS=("FuzzBinary" "FuzzJSON" "FuzzTextFormat")
+CHECK_REGRESSIONS="no"
 # Default to both
 CMD_CONFIGS=("debug" "release")
 
@@ -20,6 +22,9 @@ while [[ $# != 0 ]]; do
     --both )
       CMD_CONFIGS=("debug" "release")
       ;;
+    --run-regressions | --run )
+      CHECK_REGRESSIONS="yes"
+      ;;
     -*)
       echo "ERROR: Unknown option: ${1}" 1>&2
       exit 1
@@ -46,7 +51,18 @@ else
 fi
 
 for CMD_CONFIG in "${CMD_CONFIGS[@]}"; do
+  echo "------------------------------------------------------------------------------------------"
   echo "Building: ${CMD_CONFIG}"
   echo "${CMD_BASE[@]}" -c "${CMD_CONFIG}"
   "${CMD_BASE[@]}" -c "${CMD_CONFIG}"
+
+  if [[ "${CHECK_REGRESSIONS}" == "yes" ]] ; then
+    for FUZZ_TEST in "${FUZZ_TESTS[@]}"; do
+      # Don't worry about running the test cases against the right binaries, they should
+      # all be able to handle any input.
+      echo "------------------------------------------------------------------------------------------"
+      echo "Regressing: ${FUZZ_TEST}"
+      ".build/${CMD_CONFIG}/${FUZZ_TEST}" FailCases/*
+    done
+  fi
 done