forked from elastic/beats
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
32 lines (26 loc) · 1.09 KB
/
Makefile
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
BUILD_DIR=build
COVERAGE_DIR=${BUILD_DIR}/coverage
PROJECTS=packetbeat topbeat filebeat winlogbeat
# Runs testsuites for all beats
testsuite:
$(foreach var,$(PROJECTS),make -C $(var) testsuite;)
.PHONY: coverage-report
coverage-report:
mkdir -p ${COVERAGE_DIR}
# Writes atomic mode on top of file
echo 'mode: atomic' > ./${COVERAGE_DIR}/full.cov
# Collects all coverage files and skips top line with mode
-tail -q -n +2 ./filebeat/${COVERAGE_DIR}/*.cov >> ./${COVERAGE_DIR}/full.cov
-tail -q -n +2 ./packetbeat/${COVERAGE_DIR}/*.cov >> ./${COVERAGE_DIR}/full.cov
-tail -q -n +2 ./topbeat/${COVERAGE_DIR}/*.cov >> ./${COVERAGE_DIR}/full.cov
-tail -q -n +2 ./winlogbeat/${COVERAGE_DIR}/*.cov >> ./${COVERAGE_DIR}/full.cov
-tail -q -n +2 ./libbeat/${COVERAGE_DIR}/*.cov >> ./${COVERAGE_DIR}/full.cov
go tool cover -html=./${COVERAGE_DIR}/full.cov -o ${COVERAGE_DIR}/full.html
clean:
$(foreach var,$(PROJECTS),make -C $(var) clean;)
check:
$(foreach var,$(PROJECTS),make -C $(var) check;)
fmt:
$(foreach var,$(PROJECTS),make -C $(var) fmt;)
simplify:
$(foreach var,$(PROJECTS),make -C $(var) simplify;)