Skip to content

Commit

Permalink
CI's lib usage test
Browse files Browse the repository at this point in the history
  • Loading branch information
alobbs committed Apr 24, 2014
1 parent 83ea55a commit 27c5351
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ matrix:
- env: BUILD=arm
allow_failures:
- env: BUILD=arm
- env: BUILD=lib-usage

cache: apt

Expand All @@ -30,6 +31,7 @@ script:
- if [ x$BUILD == xcmake ]; then ./CI/build.sh; fi
- if [ x$BUILD == xtarball-dist ]; then ./CI/tarball.sh; fi
- if [ x$BUILD == xarm ]; then ./CI/debian-arm.sh; fi
- if [ x$BUILD == xlib-usage ]; then ./CI/lib-usage.sh; fi

after_success: |
if [ x$COVERALLS == xyes ]; then \
Expand Down
16 changes: 16 additions & 0 deletions CI/lib-usage-1.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */

#include <libhpack/header_parser.h>

int
main()
{
ret_t ret;
hpack_header_table_t *table;

ret = hpack_header_table_new (&table);
if (ret ! = ret_ok) return 1;

hpack_header_table_free (table);
return 0;
}
17 changes: 17 additions & 0 deletions CI/lib-usage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

# Play it safe: exit if something fails
set -e -o pipefail -o errtrace -o functrace

# Install libhpack
make all doc -j
sudo make -C build install

# Compile tests
HPACK_CFLAGS=`pkg-config --cflags libhpack`
HPACK_LIBS=`pkg-config --libs libhpack`

cd CI
$CC -c -o lib-usage-1.o lib-usage-1.c ${HPACK_CFLAGS}
$CC -o lib-usage-1 lib-usage-1.o ${HPACK_LIBS}
cd ..

0 comments on commit 27c5351

Please sign in to comment.