Adds test coverage with gcov & lcov ++
This commit is contained in:
parent
50dc2d2881
commit
a57e875b07
9 changed files with 118 additions and 17 deletions
25
Makefile.am
25
Makefile.am
|
|
@ -1,5 +1,4 @@
|
|||
bin_PROGRAMS = asmsh child
|
||||
noinst_LIBRARIES = libcheck_asmsh.a
|
||||
|
||||
libcheck_asmsh_a_SOURCES = mmap_parse.c asm_env.c compile.c logger.c
|
||||
|
||||
|
|
@ -8,8 +7,32 @@ child_SOURCES = child.s
|
|||
|
||||
SUBDIRS =
|
||||
if CHECK
|
||||
noinst_LIBRARIES = libcheck_asmsh.a
|
||||
libcheck_asmsh_a_CFLAGS = @CFLAGS@ -fprofile-arcs -ftest-coverage
|
||||
SUBDIRS += tests
|
||||
|
||||
LCOV_INFO=lcov.info
|
||||
LCOV_HTML=lcov_html
|
||||
|
||||
checks: check coverage
|
||||
|
||||
coverage: $(LCOV_HTML)
|
||||
|
||||
$(LCOV_INFO): gcov
|
||||
lcov --capture --directory . --output-file $@
|
||||
|
||||
$(LCOV_HTML): $(LCOV_INFO)
|
||||
genhtml $< --output-directory $@
|
||||
|
||||
gcov: *.gcno
|
||||
gcov -j $^
|
||||
|
||||
clean-local:
|
||||
-rm -rf *.gcov *.gcda *.gcno $(LCOV_INFO) $(LCOV_HTML)
|
||||
|
||||
endif
|
||||
|
||||
child$(EXEEXT): $(child_SOURCES:.s=.o)
|
||||
ld $(child_LDFLAGS) -o $@ $<
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue