contrib/fuzz/Makefile
author Gregory Szorc <gregory.szorc@gmail.com>
Wed, 04 Apr 2018 14:09:02 -0700
changeset 37415 c2c8962a9465
parent 36765 04d64163039a
child 38173 fa0ddd5e8fff
permissions -rw-r--r--
simplestore: use a custom store for the simple store repo Before, we used the default store, which was based on fncache and dotencode. After attempting to port tests to work with the simple store, I realized that fncache was more trouble than it is worth. This commit implements a proper store type for the simple repo - one that isn't based off fncache. This causes a number of new test failures because of tests expecting the full fncache store filename encoding. I may extend the store format in a subsequent commit to take the filename encoding parts of fncache that we can take (basically everything except hash encoding, since that isn't reversible). But for now, let's use encoded store. As part of this, we implement proper requirements support for repos created with the simple store. This should have been done from the beginning, as a requirement is needed to lock out clients that don't understand a storage format. A new hghave feature advertising the presence of fncache in repos has been added. Most tests touching the fncache are now conditional on that feature. Other tests have added the optional repo requirement to output. Differential Revision: https://phab.mercurial-scm.org/D3095
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
35670
2b9e2415f5b5 contrib: add some basic scaffolding for some fuzz test targets
Augie Fackler <augie@google.com>
parents:
diff changeset
     1
bdiff.o: ../../mercurial/bdiff.c
2b9e2415f5b5 contrib: add some basic scaffolding for some fuzz test targets
Augie Fackler <augie@google.com>
parents:
diff changeset
     2
	clang -g -O1 -fsanitize=fuzzer-no-link,address -c -o bdiff.o \
2b9e2415f5b5 contrib: add some basic scaffolding for some fuzz test targets
Augie Fackler <augie@google.com>
parents:
diff changeset
     3
	  ../../mercurial/bdiff.c
2b9e2415f5b5 contrib: add some basic scaffolding for some fuzz test targets
Augie Fackler <augie@google.com>
parents:
diff changeset
     4
2b9e2415f5b5 contrib: add some basic scaffolding for some fuzz test targets
Augie Fackler <augie@google.com>
parents:
diff changeset
     5
bdiff: bdiff.cc bdiff.o
2b9e2415f5b5 contrib: add some basic scaffolding for some fuzz test targets
Augie Fackler <augie@google.com>
parents:
diff changeset
     6
	clang -DHG_FUZZER_INCLUDE_MAIN=1 -g -O1 -fsanitize=fuzzer-no-link,address \
2b9e2415f5b5 contrib: add some basic scaffolding for some fuzz test targets
Augie Fackler <augie@google.com>
parents:
diff changeset
     7
	  -I../../mercurial bdiff.cc bdiff.o -o bdiff
2b9e2415f5b5 contrib: add some basic scaffolding for some fuzz test targets
Augie Fackler <augie@google.com>
parents:
diff changeset
     8
2b9e2415f5b5 contrib: add some basic scaffolding for some fuzz test targets
Augie Fackler <augie@google.com>
parents:
diff changeset
     9
bdiff-oss-fuzz.o: ../../mercurial/bdiff.c
2b9e2415f5b5 contrib: add some basic scaffolding for some fuzz test targets
Augie Fackler <augie@google.com>
parents:
diff changeset
    10
	$$CC $$CFLAGS -c -o bdiff-oss-fuzz.o ../../mercurial/bdiff.c
2b9e2415f5b5 contrib: add some basic scaffolding for some fuzz test targets
Augie Fackler <augie@google.com>
parents:
diff changeset
    11
2b9e2415f5b5 contrib: add some basic scaffolding for some fuzz test targets
Augie Fackler <augie@google.com>
parents:
diff changeset
    12
bdiff_fuzzer: bdiff.cc bdiff-oss-fuzz.o
2b9e2415f5b5 contrib: add some basic scaffolding for some fuzz test targets
Augie Fackler <augie@google.com>
parents:
diff changeset
    13
	$$CXX $$CXXFLAGS -std=c++11 -I../../mercurial bdiff.cc \
2b9e2415f5b5 contrib: add some basic scaffolding for some fuzz test targets
Augie Fackler <augie@google.com>
parents:
diff changeset
    14
	  bdiff-oss-fuzz.o -lFuzzingEngine -o $$OUT/bdiff_fuzzer
2b9e2415f5b5 contrib: add some basic scaffolding for some fuzz test targets
Augie Fackler <augie@google.com>
parents:
diff changeset
    15
36679
624cbd1477a6 fuzz: add a fuzzer for xdiff
Augie Fackler <augie@google.com>
parents: 35670
diff changeset
    16
x%.o: ../../mercurial/thirdparty/xdiff/x%.c ../../mercurial/thirdparty/xdiff/*.h
624cbd1477a6 fuzz: add a fuzzer for xdiff
Augie Fackler <augie@google.com>
parents: 35670
diff changeset
    17
	clang -g -O1 -fsanitize=fuzzer-no-link,address -c \
624cbd1477a6 fuzz: add a fuzzer for xdiff
Augie Fackler <augie@google.com>
parents: 35670
diff changeset
    18
	  -o $@ \
624cbd1477a6 fuzz: add a fuzzer for xdiff
Augie Fackler <augie@google.com>
parents: 35670
diff changeset
    19
	  $<
624cbd1477a6 fuzz: add a fuzzer for xdiff
Augie Fackler <augie@google.com>
parents: 35670
diff changeset
    20
36765
04d64163039a fuzz: fix xdiff build
Jun Wu <quark@fb.com>
parents: 36679
diff changeset
    21
xdiff: xdiff.cc xdiffi.o xprepare.o  xutils.o
36679
624cbd1477a6 fuzz: add a fuzzer for xdiff
Augie Fackler <augie@google.com>
parents: 35670
diff changeset
    22
	clang -DHG_FUZZER_INCLUDE_MAIN=1 -g -O1 -fsanitize=fuzzer-no-link,address \
624cbd1477a6 fuzz: add a fuzzer for xdiff
Augie Fackler <augie@google.com>
parents: 35670
diff changeset
    23
	  -I../../mercurial xdiff.cc \
36765
04d64163039a fuzz: fix xdiff build
Jun Wu <quark@fb.com>
parents: 36679
diff changeset
    24
	  xdiffi.o xprepare.o xutils.o -o xdiff
35670
2b9e2415f5b5 contrib: add some basic scaffolding for some fuzz test targets
Augie Fackler <augie@google.com>
parents:
diff changeset
    25
36679
624cbd1477a6 fuzz: add a fuzzer for xdiff
Augie Fackler <augie@google.com>
parents: 35670
diff changeset
    26
fuzz-x%.o: ../../mercurial/thirdparty/xdiff/x%.c ../../mercurial/thirdparty/xdiff/*.h
624cbd1477a6 fuzz: add a fuzzer for xdiff
Augie Fackler <augie@google.com>
parents: 35670
diff changeset
    27
	$$CC $$CFLAGS -c \
624cbd1477a6 fuzz: add a fuzzer for xdiff
Augie Fackler <augie@google.com>
parents: 35670
diff changeset
    28
	  -o $@ \
624cbd1477a6 fuzz: add a fuzzer for xdiff
Augie Fackler <augie@google.com>
parents: 35670
diff changeset
    29
	  $<
624cbd1477a6 fuzz: add a fuzzer for xdiff
Augie Fackler <augie@google.com>
parents: 35670
diff changeset
    30
36765
04d64163039a fuzz: fix xdiff build
Jun Wu <quark@fb.com>
parents: 36679
diff changeset
    31
xdiff_fuzzer: xdiff.cc fuzz-xdiffi.o fuzz-xprepare.o  fuzz-xutils.o
36679
624cbd1477a6 fuzz: add a fuzzer for xdiff
Augie Fackler <augie@google.com>
parents: 35670
diff changeset
    32
	$$CXX $$CXXFLAGS -std=c++11 -I../../mercurial xdiff.cc \
36765
04d64163039a fuzz: fix xdiff build
Jun Wu <quark@fb.com>
parents: 36679
diff changeset
    33
	  fuzz-xdiffi.o fuzz-xprepare.o fuzz-xutils.o \
36679
624cbd1477a6 fuzz: add a fuzzer for xdiff
Augie Fackler <augie@google.com>
parents: 35670
diff changeset
    34
	  -lFuzzingEngine -o $$OUT/xdiff_fuzzer
624cbd1477a6 fuzz: add a fuzzer for xdiff
Augie Fackler <augie@google.com>
parents: 35670
diff changeset
    35
624cbd1477a6 fuzz: add a fuzzer for xdiff
Augie Fackler <augie@google.com>
parents: 35670
diff changeset
    36
all: bdiff xdiff
624cbd1477a6 fuzz: add a fuzzer for xdiff
Augie Fackler <augie@google.com>
parents: 35670
diff changeset
    37
624cbd1477a6 fuzz: add a fuzzer for xdiff
Augie Fackler <augie@google.com>
parents: 35670
diff changeset
    38
oss-fuzz: bdiff_fuzzer xdiff_fuzzer
35670
2b9e2415f5b5 contrib: add some basic scaffolding for some fuzz test targets
Augie Fackler <augie@google.com>
parents:
diff changeset
    39
2b9e2415f5b5 contrib: add some basic scaffolding for some fuzz test targets
Augie Fackler <augie@google.com>
parents:
diff changeset
    40
.PHONY: all oss-fuzz