From 1b370fa228867889c4855bb310b1bbacaf9dfefd Mon Sep 17 00:00:00 2001 From: jcorks Date: Tue, 23 Feb 2021 23:05:57 -0500 Subject: [PATCH] Experimenting with codecov integration. --- .travis.yml | 11 +++++++---- ci_build.sh | 10 ++++++++++ makefile | 3 ++- 3 files changed, 19 insertions(+), 5 deletions(-) create mode 100644 ci_build.sh diff --git a/.travis.yml b/.travis.yml index 8241cb7..4c17a04 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,21 +4,24 @@ jobs: include: - os: linux compiler: gcc - script: make + script: sh ./ci_build.sh + after_success: + - bash <(curl -s https://codecov.io/bash) + - os: linux compiler: clang - script: make + script: make - os: osx compiler: gcc - script: make + script: make - os: osx compiler: clang - script: make + script: make diff --git a/ci_build.sh b/ci_build.sh new file mode 100644 index 0000000..c0811cc --- /dev/null +++ b/ci_build.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +# a build file for delivering coverage results for the test case. +# Not really useful to anyone using tPNG! + +make +cd ./tests/ +./tpng_test +cd .. +gcov tpng.c diff --git a/makefile b/makefile index c3417ec..93ec0cb 100644 --- a/makefile +++ b/makefile @@ -6,13 +6,14 @@ # just add the tpng.c and tpng.h file to your project add compile it. all: - $(CC) tpng.c -Wall -O2 -std=c99 tests/driver.c -o ./tests/tpng_test + $(CC) tpng.c -coverage -Wall -O2 -std=c99 tests/driver.c -o ./tests/tpng_test $(CC) tpng.c -Wall -O2 -std=c99 example/helper.c example/main.c -o ./example/example debug: $(CC) tpng.c -Wall -std=c99 -fsanitize=address -fsanitize=undefined -g tests/driver.c -o ./tests/tpng_test $(CC) tpng.c -Wall -std=c99 -fsanitize=address -fsanitize=undefined -g example/helper.c example/main.c -o ./example/example + clean: rm ./tests/tpng_test rm ./example/example