diff options
| author | EuAndreh <eu@euandre.org> | 2024-10-02 13:43:47 -0300 |
|---|---|---|
| committer | EuAndreh <eu@euandre.org> | 2024-10-02 13:43:47 -0300 |
| commit | e6561e006273edc64baf6b3af30e26a3817214d2 (patch) | |
| tree | 940042d3d791672caccc43b1056d8bc4078bdacc /Makefile | |
| parent | Makefile: Add fuzz target setup (diff) | |
| download | golite-e6561e006273edc64baf6b3af30e26a3817214d2.tar.gz golite-e6561e006273edc64baf6b3af30e26a3817214d2.tar.xz | |
Makefile: Setup benchmarking skeleton
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 19 |
1 files changed, 13 insertions, 6 deletions
@@ -39,6 +39,8 @@ functional-tests.a = $(functional-tests.go:.go=.a) functional-tests.bin = $(functional-tests.go:.go=.bin) fuzz-targets.a = $(fuzz-targets.go:.go=.a) fuzz-targets.bin = $(fuzz-targets.go:.go=.bin) +benchmarks.a = $(benchmarks.go:.go=.a) +benchmarks.bin = $(benchmarks.go:.go=.bin) cgo.go = \ src/_cgo_import.go \ @@ -71,6 +73,8 @@ derived-assets = \ tests/functional/streq.so \ $(fuzz-targets.a) \ $(fuzz-targets.bin) \ + $(benchmarks.a) \ + $(benchmarks.bin) \ side-assets = \ src/_cgo_export.h \ @@ -87,7 +91,7 @@ $(derived-assets): Makefile deps.mk $(cgo.go) $(cgo.c) $(cgo.o): src/_cgo_.o -$(functional-tests.a) $(fuzz-targets.a): src/$(NAME).a +$(functional-tests.a) $(fuzz-targets.a) $(benchmarks.a): src/$(NAME).a src/_cgo_.o: src/$(NAME).go @@ -113,13 +117,13 @@ tests/main.bin: tests/main.a src/version.go: Makefile echo 'package $(NAME); const Version = "$(VERSION)"' > $@ -$(functional-tests.a): +$(functional-tests.a) $(benchmarks.a): go tool compile $(GOCFLAGS) -o $@ -p main -I src $*.go $(fuzz-targets.a): go tool compile -d=libfuzzer $(GOCFLAGS) -o $@ -p main -I src $*.go -$(functional-tests.bin) $(fuzz-targets.bin): +$(functional-tests.bin) $(fuzz-targets.bin) $(benchmarks.bin): go tool link $(GOLDFLAGS) -o $@ -L src --extldflags '$(LDLIBS)' $*.a tests/functional/streq.so: tests/functional/streq.c @@ -165,14 +169,17 @@ FUZZSEC=1 fuzz-targets.bin-check = $(fuzz-targets.go:.go=.bin-check) $(fuzz-targets.bin-check): $(EXEC)$*.bin --test.fuzztime=$(FUZZSEC)s \ - --test.fuzz=Fuzz --test.fuzzcachedir=tests/fuzz/corpus + --test.fuzz='.*' --test.fuzzcachedir=tests/fuzz/corpus fuzz: $(fuzz-targets.bin-check) -bench: tests/main.bin - $(EXEC)tests/main.bin -test.bench '.*' +benchmarks.bin-check = $(benchmarks.go:.go=.bin-check) +$(benchmarks.bin-check): + $(EXEC)$*.bin + +bench: $(benchmarks.bin-check) |
