Add make target for coverage
authorAaron Traas <aaron@traas.org>
Wed, 28 Jun 2017 18:35:17 +0000 (14:35 -0400)
committerAaron Traas <aaron@traas.org>
Thu, 29 Jun 2017 14:16:40 +0000 (10:16 -0400)
.gitignore
.gitlab-ci.yml
Makefile

index b658e262008f17660e11a684803b9c3688e977a3..a99743d641bc5f0d34a1803ac40affc03d503017 100644 (file)
@@ -13,4 +13,5 @@ MANIFEST
 newdb.h
 newdb.c
 cheat
 newdb.h
 newdb.c
 cheat
-advent.info
\ No newline at end of file
+advent.info
+coverage/*
\ No newline at end of file
index 45531263d9cdfcb3988661d9d6e31b5fa160a9a7..20e466b958fca76dcbd8515397b5246bfcb539cc 100644 (file)
@@ -88,11 +88,7 @@ test:debug:
     - apk add make gcc
     - apk add lcov --update-cache --repository http://dl-3.alpinelinux.org/alpine/edge/testing/ --allow-untrusted
   script:
     - apk add make gcc
     - apk add lcov --update-cache --repository http://dl-3.alpinelinux.org/alpine/edge/testing/ --allow-untrusted
   script:
-    - cd tests
-    - make
-    - cd ..
-    - lcov -t "advent" -o advent.info -c -d .
-    - genhtml -o coverage advent.info
+    - make coverage
   artifacts:
     paths:
       - coverage
   artifacts:
     paths:
       - coverage
index 6e245490d4b5306dafed340dd5e66962bec6a898..d9436e0d7633ec0acb01977cdb4644b8b5ac385f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -152,3 +152,8 @@ linty: advent
 debug: CCFLAGS += -O0 --coverage -ggdb
 debug: linty
 debug: cheat
 debug: CCFLAGS += -O0 --coverage -ggdb
 debug: linty
 debug: cheat
+
+coverage: debug check
+       lcov -t "advent" -o advent.info -c -d .
+       genhtml -o coverage/ advent.info
+