From 04446ce562eee129588f2c92c4eef2c82ed4bb4f Mon Sep 17 00:00:00 2001 From: Vegard Nossum Date: Sun, 12 Mar 2017 14:35:25 +0100 Subject: [PATCH] test-lib: add --fuzzing option From t/README: This causes additional testcases found by fuzzing to be run, for more exhaustive testing. Please note that these testcases have not been vetted for correctness, but they may uncover bugs introduced in code paths which are not otherwise run in other tests. The -f/--fuzzing/FUZZING name is up for discussion, I just couldn't think of anything more descriptive. --- t/README | 8 ++++++++ t/t5300-pack-object.sh | 2 +- t/test-lib.sh | 6 ++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/t/README b/t/README index 4982d1c52..2c56567b1 100644 --- a/t/README +++ b/t/README @@ -110,6 +110,14 @@ appropriately before running "make". This causes additional long-running tests to be run (where available), for more exhaustive testing. +-f:: +--fuzzing:: + This causes additional testcases found by fuzzing to be run, + for more exhaustive testing. Please note that these testcases + have not been vetted for correctness, but they may uncover + bugs introduced in code paths which are not otherwise run + in other tests. + -r:: --run=:: Run only the subset of tests indicated by diff --git a/t/t5300-pack-object.sh b/t/t5300-pack-object.sh index 19e02ffc2..f58d0d4bf 100755 --- a/t/t5300-pack-object.sh +++ b/t/t5300-pack-object.sh @@ -422,7 +422,7 @@ test_expect_success 'index-pack works in non-repo' ' ' # These pack files were generated using AFL -test_expect_success 'index-pack edge coverage' ' +test_expect_success FUZZING 'index-pack edge coverage' ' for pack in "$TEST_DIRECTORY"/t5300/*.pack do rm -rf "${pack%.pack}.idx" && diff --git a/t/test-lib.sh b/t/test-lib.sh index 86d77c16d..35df2bd6c 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -209,6 +209,8 @@ do immediate=t; shift ;; -l|--l|--lo|--lon|--long|--long-|--long-t|--long-te|--long-tes|--long-test|--long-tests) GIT_TEST_LONG=t; export GIT_TEST_LONG; shift ;; + -f|--f|--fuzzing) + GIT_TEST_FUZZING=t; export GIT_TEST_FUZZING; shift ;; -r) shift; test "$#" -ne 0 || { echo 'error: -r requires an argument' >&2; @@ -1098,6 +1100,10 @@ test_lazy_prereq EXPENSIVE ' test -n "$GIT_TEST_LONG" ' +test_lazy_prereq FUZZING ' + test -n "$GIT_TEST_FUZZING" +' + test_lazy_prereq USR_BIN_TIME ' test -x /usr/bin/time ' -- 2.12.0.rc0