forked from nimble-code/Spin
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
88 lines (71 loc) · 2.6 KB
/
makefile
File metadata and controls
88 lines (71 loc) · 2.6 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
all:
cd Src; make
install:
cd Src; make install
clean:
cd Src; make clean
rm -rf test/work coverage cppcheck-report.xml
# Run test suite (all test types)
test: all test-unit test-integration test-e2e test-negative test-functional
# Functional tests (basic spin functionality)
test-functional: all
@echo "=== Running Functional Tests ==="
./test/run_tests.sh
# Unit tests (C function testing)
test-unit:
@echo "=== Running Unit Tests ==="
cd test/unit && make test
# Integration tests (workflow testing)
test-integration: all
@echo "=== Running Integration Tests ==="
./test/integration/run_integration_tests.sh
# End-to-end tests (real-world scenarios)
test-e2e: all
@echo "=== Running End-to-End Tests ==="
./test/e2e/run_e2e_tests.sh
# Negative tests (verify Spin finds expected bugs)
test-negative: all
@echo "=== Running Negative Tests ==="
./test/e2e/negative_tests.sh
# Quick test (just functional)
test-quick: all
./test/run_tests.sh
# Build with coverage instrumentation
coverage-build:
cd Src; make clean
cd Src; make CFLAGS="-O0 -g --coverage -DNXT -Wall" LDFLAGS="--coverage"
# Run tests and generate coverage report
coverage: coverage-build
./test/run_tests.sh || true
mkdir -p coverage
lcov --capture --directory Src --output-file coverage/coverage.info --ignore-errors source
lcov --remove coverage/coverage.info '/usr/*' --output-file coverage/coverage.info --ignore-errors unused || true
genhtml coverage/coverage.info --output-directory coverage/html --ignore-errors source --synthesize-missing
@echo "Coverage report: coverage/html/index.html"
# Quick coverage summary without HTML report
coverage-summary: coverage-build
./test/run_tests.sh || true
gcov -n Src/*.c 2>/dev/null | grep -A 1 "File '"
# Static analysis with cppcheck
cppcheck:
cppcheck --enable=warning,style,performance,portability \
--suppress=missingIncludeSystem \
--suppress=unusedFunction \
Src/*.c
# Static analysis with cppcheck (verbose XML report)
cppcheck-xml:
cppcheck --enable=warning,style,performance,portability \
--suppress=missingIncludeSystem \
--suppress=unusedFunction \
--xml --xml-version=2 \
Src/*.c 2> cppcheck-report.xml
@echo "Report saved to cppcheck-report.xml"
# Build with strict warnings
strict:
cd Src; make clean
cd Src; make CFLAGS="-O2 -DNXT -Wall -Wextra -Wformat=2 -Wformat-security -Wshadow -pedantic"
# Run clang static analyzer
scan-build:
cd Src; make clean
cd Src; scan-build make
.PHONY: all install clean test test-unit test-integration test-e2e test-negative test-functional test-quick coverage coverage-build coverage-summary cppcheck cppcheck-xml strict scan-build