From: Vegard Nossum <vegard.nossum@oracle.com>
To: "Jeff King" <peff@peff.net>,
"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Cc: Junio C Hamano <gitster@pobox.com>,
Git Mailing List <git@vger.kernel.org>
Subject: Re: [RFC][PATCH] index-pack: add testcases found using AFL
Date: Sun, 12 Mar 2017 14:44:52 +0100 [thread overview]
Message-ID: <8fb54c74-a5a5-eb55-8734-61a3753c05e1@oracle.com> (raw)
In-Reply-To: <20170312123212.3rnqyx3dvi5yppk5@sigill.intra.peff.net>
[-- Attachment #1: Type: text/plain, Size: 1157 bytes --]
On 12/03/2017 13:32, Jeff King wrote:
> If people really _do_ care about coverage, arguably the AFL tests are a
> pollution of that concept. Because they are running the code, but doing
> a very perfunctory job of testing it. IOW, our coverage of "code that
> doesn't segfault or trigger ASAN" is improved, but our coverage of "code
> that has been tested to be correct" is not (and since the tests are
> lumped together, it's hard to get anything but one number).
It wouldn't be hard to separate out the testcases found by fuzzing
I've attached a patch that does just that -- none of the new testcases
are run unless you pass -f/--fuzzing in GIT_TEST_OPTS.
$ make -C t GIT_TEST_OPTS="--run=34" t5300-pack-object.sh
make: Entering directory '/home/vegard/git/git/t'
*** t5300-pack-object.sh ***
[...]
ok 34 # skip index-pack edge coverage (missing FUZZING)
[...]
$ make -C t GIT_TEST_OPTS="--run=34 -f" t5300-pack-object.sh
make: Entering directory '/home/vegard/git/git/t'
*** t5300-pack-object.sh ***
[...]
ok 34 - index-pack edge coverage
[...]
I assume automatic testing like e.g. Travis would want to enable this.
Would that help at all?
Vegard
[-- Attachment #2: 0001-test-lib-add-fuzzing-option.patch --]
[-- Type: text/x-patch, Size: 2533 bytes --]
From 04446ce562eee129588f2c92c4eef2c82ed4bb4f Mon Sep 17 00:00:00 2001
From: Vegard Nossum <vegard.nossum@oracle.com>
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=<test-selector>::
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 <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
next prev parent reply other threads:[~2017-03-12 13:45 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20170310151556.18490-1-vegard.nossum@oracle.com>
2017-03-10 16:00 ` [RFC][PATCH] index-pack: add testcases found using AFL Vegard Nossum
2017-03-10 19:06 ` Jeff King
2017-03-10 19:34 ` Vegard Nossum
2017-03-10 19:42 ` Jeff King
2017-03-10 21:18 ` Vegard Nossum
2017-03-12 12:24 ` Jeff King
2017-03-10 22:58 ` Ævar Arnfjörð Bjarmason
2017-03-12 12:32 ` Jeff King
2017-03-12 13:44 ` Vegard Nossum [this message]
2017-03-12 18:14 ` Junio C Hamano
2017-03-13 11:07 ` Vegard Nossum
2017-03-13 17:11 ` Junio C Hamano
2017-03-13 19:13 ` Vegard Nossum
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8fb54c74-a5a5-eb55-8734-61a3753c05e1@oracle.com \
--to=vegard.nossum@oracle.com \
--cc=avarab@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=peff@peff.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).