Skip to content

Commit

Permalink
Merge e1969d2 into f95bcc7
Browse files Browse the repository at this point in the history
  • Loading branch information
sinemetu1 committed Jan 2, 2015
2 parents f95bcc7 + e1969d2 commit 6bebe32
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 6 deletions.
14 changes: 8 additions & 6 deletions .travis.yml
@@ -1,21 +1,23 @@
language: c
before_install:
- sudo apt-get install valgrind
- ./install_deps.sh /home/travis
- sudo apt-get install valgrind
- mkdir /home/travis/deps
- ./install_deps.sh /home/travis/deps
- sudo pip install cpp-coveralls
install: libtoolize && ./autogen.sh && ./configure
compiler:
- gcc
script: make check && make check-valgrind
script: make check
env:
global:
- TWITC_KEY=A TWITC_SECRET=B TWITC_ACCESS_TOKEN=C TWITC_ACCESS_SECRET=D
- CFLAGS="-I/home/travis/include -L/home/travis/lib"
- CFLAGS="-I/home/travis/deps/include -L/home/travis/deps/lib"
after_failure:
- ls /home/travis/build/sinemetu1/twitc/src
- ls /home/travis/build/sinemetu1/twitc/src/test
- cat /home/travis/build/sinemetu1/twitc/src/test-suite.log
- cat /home/travis/build/sinemetu1/twitc/src/test/test_reply.log
- cat /home/travis/build/sinemetu1/twitc/src/test/test_twitc.log
after_success:
- ls /home/travis/build/sinemetu1/twitc/src
- ls /home/travis/build/sinemetu1/twitc/src/test
- make check-valgrind
- ./configure --enable-gcov && make clean coverage && coveralls -b src/ --no-gcov
3 changes: 3 additions & 0 deletions Makefile.am
Expand Up @@ -11,3 +11,6 @@ integration:

check-valgrind:
cd src; make check-valgrind;

coverage:
cd src; make coverage;
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -2,6 +2,7 @@ twitc
===========

[![Build Status](https://travis-ci.org/sinemetu1/twitc.svg)](https://travis-ci.org/sinemetu1/twitc)
[![Coverage Status](https://coveralls.io/repos/sinemetu1/twitc/badge.png)](https://coveralls.io/r/sinemetu1/twitc)

A mini C library for interacting with the Twitter OAuth api.

Expand Down
13 changes: 13 additions & 0 deletions configure.ac
Expand Up @@ -20,6 +20,19 @@ CFLAGS="$CFLAGS "
CFLAGS+="-Wall -Wstrict-prototypes -Wmissing-prototypes "
CFLAGS+="-Wmissing-declarations -Wshadow -Wpointer-arith -Wcast-qual "
CFLAGS+="-Wsign-compare -Iincludes -g "

AC_ARG_ENABLE([gcov],
AS_HELP_STRING([--enable-gcov], [enable gcov code-coverage(default=no)]),
[],
[enable_gcov=no]
)

AS_IF([test "x$enable_gcov" = "xyes"],
[CFLAGS+="-fprofile-arcs -ftest-coverage "],
[test "x$enable_gcov" = "xno"], [CFLAGS+=" "],
[echo "enable-gcov with wrong value"]
)

AC_SUBST([CFLAGS])

AC_PROG_CC
Expand Down
10 changes: 10 additions & 0 deletions src/Makefile.am
Expand Up @@ -37,5 +37,15 @@ check-valgrind:
valgrind --leak-check=full --track-origins=yes test/test_twitc
valgrind --leak-check=full --track-origins=yes test/test_reply

coverage: clean check
gcov twitc.c -o test_test_twitc-twitc.o -f
gcov test/test_twitc.c -o test/test_test_twitc-test_twitc.o -f
gcov twitc_reply.c -o test_test_reply-twitc_reply.o -f
gcov test/test_reply.c -o test/test_test_reply-test_reply.o -f

clean-local:
find ./ ./test/ -type f -name "*.gc*" -exec rm {} \;
find ./test/ -type f -name "integration" -exec rm {} \;

integration: test/integration
test/integration

0 comments on commit 6bebe32

Please sign in to comment.