diff --git a/.travis-ci-build b/.travis-ci-build new file mode 100755 index 0000000..0bf553e --- /dev/null +++ b/.travis-ci-build @@ -0,0 +1,22 @@ +#!/bin/sh +cd $1 + +if [ "$BLD" = autotools ]; then + set -ex + autoreconf -vis + mkdir build-autotools + cd build-autotools + ../configure --prefix=$HOME/.local LIBNFC_CFLAGS="-I$HOME/.local/include" LIBNFC_LIBS="-L$HOME/.local/lib -lnfc" + make + make install +elif [ "$BLD" = cmake ]; then + set -ex + mkdir build-cmake + cd build-cmake + cmake -DCMAKE_INSTALL_PREFIX=$HOME/.local .. + make + make install +else + echo "Unsupported build system: '$BLD'" >&2 + exit 1 +fi diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..62746ff --- /dev/null +++ b/.travis.yml @@ -0,0 +1,25 @@ +language: c + +compiler: + - clang + - gcc + +env: + - BLD=cmake + - BLD=autotools + +addons: + apt: + sources: + - sourceline: 'ppa:cutter-testing-framework/ppa' + packages: + - libusb-dev + - cmake + - cutter-testing-framework + +install: + - git clone https://github.com/nfc-tools/libnfc + - ./.travis-ci-build libnfc +script: + - ./.travis-ci-build . + - if [ "$BLD" = autotools ]; then (cd build-autotools && make check TESTS_ENVIRONMENT=SKIP_TESTS=1 && cutter test); fi diff --git a/test/run-test.sh b/test/run-test.sh index 2c8bc7b..2feb389 100755 --- a/test/run-test.sh +++ b/test/run-test.sh @@ -1,5 +1,9 @@ #!/bin/sh +if [ -n "${SKIP_TESTS}" ]; then + exit 0 +fi + export BASE_DIR="`dirname $0`" if test -z "$NO_MAKE"; then