Makefile 728 Bytes
Newer Older
Thanassis Tsiodras's avatar
Thanassis Tsiodras committed
1
2
coverage_demo:
	gcc -g -O0 -fprofile-arcs -ftest-coverage -o $@ coverage_demo.c
Thanassis Tsiodras's avatar
Thanassis Tsiodras committed
3

Thanassis Tsiodras's avatar
Thanassis Tsiodras committed
4
5
report:	coverage_demo
	$(MAKE)
Thanassis Tsiodras's avatar
Thanassis Tsiodras committed
6
7
8
	gcov -pcb coverage_demo.c
	cat coverage_demo.c.gcov

Thanassis Tsiodras's avatar
Thanassis Tsiodras committed
9
10
11
12
13
14
15
16
17
18
19
20
21
22
decision: coverage_demo
	$(MAKE) clean
	$(MAKE)
	./coverage_demo 3 0 2
	./coverage_demo 1 0 1
	$(MAKE) report

condition: coverage_demo
	$(MAKE) clean
	$(MAKE)
	./coverage_demo 1 0 2
	./coverage_demo 2 1 1
	$(MAKE) report

Thanassis Tsiodras's avatar
Thanassis Tsiodras committed
23
24
25
26
27
28
29
conditiondecision: coverage_demo
	$(MAKE) clean
	$(MAKE)
	./coverage_demo 1 1 1
	./coverage_demo 2 0 2
	$(MAKE) report
		
Thanassis Tsiodras's avatar
Thanassis Tsiodras committed
30
31
32
33
34
35
36
37
mcdc:	coverage_demo
	$(MAKE) clean
	$(MAKE)
	./coverage_demo 2 0 1
	./coverage_demo 3 1 2
	./coverage_demo 1 0 1
	$(MAKE) report

Thanassis Tsiodras's avatar
Thanassis Tsiodras committed
38
clean:
Thanassis Tsiodras's avatar
Thanassis Tsiodras committed
39
	rm -f coverage_demo.c.gcov coverage_demo.gcda coverage_demo.gcno coverage_demo