Merge pull request #63 from nfc-tools/travis-build
Test the build with Travis-CI
This commit is contained in:
commit
2be45f60e2
3 changed files with 51 additions and 0 deletions
22
.travis-ci-build
Executable file
22
.travis-ci-build
Executable file
|
@ -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
|
25
.travis.yml
Normal file
25
.travis.yml
Normal file
|
@ -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
|
|
@ -1,5 +1,9 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
if [ -n "${SKIP_TESTS}" ]; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
export BASE_DIR="`dirname $0`"
|
export BASE_DIR="`dirname $0`"
|
||||||
|
|
||||||
if test -z "$NO_MAKE"; then
|
if test -z "$NO_MAKE"; then
|
||||||
|
|
Loading…
Reference in a new issue