Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve tests #30

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
fed2be6
Remove deprecated Fuzz testing
psadac Sep 25, 2024
8a79653
Add cover target to Makefile : display coverage in web browser
psadac Sep 25, 2024
39793d6
Add keys to struct initializations for all tests
psadac Sep 25, 2024
ff77142
Fix tests to make coverage 100% again
psadac Sep 25, 2024
f6cb3cc
Add tests with random inputs
psadac Sep 25, 2024
acf586a
Add fuzzing test
psadac Sep 30, 2024
89ac5fe
Add perf target to Makefile
psadac Oct 1, 2024
5f5ed53
Pass Makefile benchmark functions and counts as parameters
psadac Dec 22, 2024
eb2b813
Add benchmark on random inputs
psadac Dec 22, 2024
b25fcec
Add Hamming distance test to the fuzzing function
psadac Dec 22, 2024
d0e375c
Implement native fuzzing in Go
hanzei Jul 1, 2024
813c5d3
Add additional cases to corpus
hanzei Dec 17, 2024
6c730c6
Remove deprecated Fuzz testing
psadac Sep 25, 2024
52a7ed9
Add cover target to Makefile : display coverage in web browser
psadac Sep 25, 2024
3287971
Add keys to struct initializations for all tests
psadac Sep 25, 2024
a2c4ad8
Fix tests to make coverage 100% again
psadac Sep 25, 2024
bbdf631
Rebase tests
psadac Sep 25, 2024
6dd6857
Add fuzzing test
psadac Sep 30, 2024
34f642d
Add perf target to Makefile
psadac Oct 1, 2024
b031545
Pass Makefile benchmark functions and counts as parameters
psadac Dec 22, 2024
0c71811
Add benchmark on random inputs
psadac Dec 22, 2024
aa43db8
Add Hamming distance test to the fuzzing function
psadac Dec 22, 2024
7f7cac1
Merge remote-tracking branch 'origin/master'
psadac Dec 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
coverage.txt
fuzz/fuzz-fuzz.zip
fuzz/corpus/corpus/*
fuzz/corpus/suppressions/*
fuzz/corpus/crashes/*
*.out
29 changes: 27 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# FUNCS is the list of functions to run
FUNCS?=./...

# COUNT is the number of times to run each benchmark
COUNT?=5

all: test install

install:
Expand All @@ -7,7 +13,26 @@ lint:
gofmt -l -s -w . && go vet .

test:
go test -race -v -coverprofile=coverage.txt -covermode=atomic
go test -race -v -coverprofile=coverage.out -covermode=atomic

bench:
go test -run=XXX -bench=. -benchmem -count=5
go test -bench="$(FUNCS)" -benchmem -count=${COUNT}

# cover runs the tests and opens a web browser displaying annotated source code
cover: test
@if [ $$? -eq 0 ]; then \
go tool cover -html=coverage.out; \
fi

# fuzz runs all fuzzing functions
fuzz:
go test -fuzz="$(FUNCS)"

# perf compares performance using benchstat between the last commit and uncommitted code
# to install benchstat run 'go install golang.org/x/perf/cmd/benchstat@latest'
perf:
go test -bench="$(FUNCS)" -benchmem -count=${COUNT} | tee perf_after.out
git stash -q --keep-index
go test -bench="$(FUNCS)" -benchmem -count=${COUNT} | tee perf_before.out
git stash pop -q
benchstat perf_before.out perf_after.out | tee perf_diff.out
Binary file removed fuzz/fuzz-fuzz.zip
Binary file not shown.
26 changes: 0 additions & 26 deletions fuzz/fuzz.go

This file was deleted.

This file was deleted.

2 changes: 0 additions & 2 deletions fuzz/workdir/corpus/0324136bd592f82a0afb39d3eb7870d06e326c0d

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

2 changes: 0 additions & 2 deletions fuzz/workdir/corpus/1

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion fuzz/workdir/corpus/2

This file was deleted.

This file was deleted.

This file was deleted.

2 changes: 0 additions & 2 deletions fuzz/workdir/corpus/23d54ac1dac456100388367a829508a62752ddd9

This file was deleted.

2 changes: 0 additions & 2 deletions fuzz/workdir/corpus/23dd9f1cf3648138e68552009d8d7affd7868096

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

2 changes: 0 additions & 2 deletions fuzz/workdir/corpus/3

This file was deleted.

This file was deleted.

This file was deleted.

2 changes: 0 additions & 2 deletions fuzz/workdir/corpus/349599e8245643624aaa86bc2db2a33becfa9352

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

2 changes: 0 additions & 2 deletions fuzz/workdir/corpus/4

This file was deleted.

This file was deleted.

This file was deleted.

2 changes: 0 additions & 2 deletions fuzz/workdir/corpus/5

This file was deleted.

This file was deleted.

This file was deleted.

2 changes: 0 additions & 2 deletions fuzz/workdir/corpus/6

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

2 changes: 0 additions & 2 deletions fuzz/workdir/corpus/7

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

2 changes: 0 additions & 2 deletions fuzz/workdir/corpus/8

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Binary file not shown.
2 changes: 0 additions & 2 deletions fuzz/workdir/corpus/e11d22bb9287e17c26f10b826ab47a7cf49bd706

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

2 changes: 0 additions & 2 deletions fuzz/workdir/corpus/f961048abbb7c870f5d8485d60364dc93453e6e9

This file was deleted.

Loading
Loading