Re: [RFC PATCH 1/2] fuzz: Add basic fuzz testing target.
- From
Josh Steadmon <steadmon@google.com>
- Date
- Oct 13, 2018, 00:59 UTC
- Message-ID
- <20181013005918.GD12177@google.com>
- In-Reply-To
- <xmqqva6amtt7.fsf@gitster-ct.c.googlers.com>
On 2018.10.10 11:14, Junio C Hamano wrote:
Show 17 quoted lines
> Josh Steadmon <steadmon@google.com> writes:
>
> > +FUZZ_OBJS += fuzz-pack-headers.o
> > +
> > +FUZZ_PROGRAMS += $(patsubst %.o,%,$(FUZZ_OBJS))
> > +
> > ...
> > +### Fuzz testing
> > +#
> > +.PHONY: fuzz-clean fuzz-objs fuzz-compile
>
> I take it that you anticipate the fuzz programs in the future all
> be named fuzz-$(blah), whose source is fuzz-$(blah).o (even though
> we may grow some common code that may be linked with them, which can
> be done by tweaking the rule for the $(FUZZ_PROGRAMS) target). Am I
> reading you correctly? Would fuzz-{clean,objs,compile} risk squatting
> on nicer names we may want to use for $(blah) down the line?Yes, that's correct. I've reworked the rules to be more compatible with how OSS-Fuzz expects to build these targets, and now "fuzz-all" is the only remaining special target.
Show 16 quoted lines
> > + ... > > +$(FUZZ_PROGRAMS): fuzz-compile > > + clang++ $(FUZZ_LDFLAGS) $(LIB_OBJS) $(BUILTIN_OBJS) $(XDIFF_OBJS) \ > > + $(EXTLIBS) git.o $@.o /usr/lib/llvm-4.0/lib/libFuzzer.a -o $@ > > Is the expected usage pattern to know a single fuzz-* program the > builder wants to build, to run "make fuzz-pack-headers"? If not, it > also would be a good idea to have something like > > fuzz-build-all:: $(FUZZ_PROGRAMS) > .PHONY: fuzz-build-all > > perhaps? > > Also, in the final version we unleash to general developer audience, > we'd want to support "make V=1" (and "make" that is "$(QUIET)").
Done and done.