-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
50 lines (39 loc) · 1.66 KB
/
Copy pathMakefile
File metadata and controls
50 lines (39 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
.PHONY: all test lint fmt clean benchmark coverage fuzz corpus sigma-corpus rules-corpus
all: test
test:
go test -v -race ./...
lint:
golangci-lint run --config=.github/golangci.yml
fmt:
gofmt -s -w .
goimports -w -local github.com/craftedsignal/eql-parser .
clean:
go clean -testcache
benchmark:
go test -bench=. -benchmem ./...
coverage:
go test -coverprofile=coverage.out ./...
go tool cover -html=coverage.out -o coverage.html
# Run each fuzz target for a short bounded time.
fuzz:
go test -fuzz=FuzzExtractConditions -fuzztime=30s .
go test -fuzz=FuzzParse -fuzztime=30s .
# Regenerate the differential + large corpora. The generator is a nested
# module (keeps the parser itself dependency-free), so it runs from its own
# directory. REAL_CORPUS points at scraped real EQL used as generation seeds.
corpus:
cd cmd/generated-corpus && go run . \
-count $(if $(COUNT),$(COUNT),500) \
-large $(if $(LARGE),$(LARGE),500000) \
-real ../../testdata/real_eql_corpus.jsonl
# Regenerate the Sigma<->EQL round-trip corpus from the raw Sigma rule corpus
# in the sibling sigma-parser module. Requires ../sigma-parser to be present.
sigma-corpus:
cd cmd/generated-corpus && go run . -sigma-roundtrip
# Build + test the 100k+ Sigma rule corpus (scraped GitHub rules + the
# CraftedSignal library + generated complex rules), running each through
# parse -> Sigma->EQL translate -> round-trip. Emits the committed rule corpus
# and the translated-EQL corpus. Requires ../sigma-parser (and, for real rules,
# a scraped testdata/generated/sigma_rules_real.jsonl and ../library).
rules-corpus:
cd cmd/generated-corpus && go run . -rules -rules-target $(if $(RULES),$(RULES),100000)