unicorn/.travis.yml
Stephen bc08bfda67 Unit testing in CI (#651)
- in appveyor, install clang and cmake in cygwin, enable package upgrades, and build cmocka and enable testing for gcc only
- in `gitignore`, ignore generated cmocka folder
- in travis, use brew in osx to install cmocka, and enable testing for gcc and clang on os x and linux
- in `Makefile`, change to use `uname -s` to determine os type
- make `install-cmocka-linux.sh`, a simple shell script to download and install cmocka on linux
- in `bindings/Makefile`, enable `make -c` to call subdirectory makefiles instead of `cd [dir] && make` and include environment variables for runtime access to generated libraries
- in `samples/Makefile`, change to use `uname -s` to determine os type, remove `clean_bins` from `all` command, and include `Werror` for compile strictness
- in `tests/unit/Makefile`, add `cflags` for compile time access to cmocka headers and library, include execute vars for runtime access to cmocka and unicorn libs
- in `tests/unit/test_tb_x86.c`, comment out assert that would not compile
2016-10-22 00:21:10 +08:00

44 lines
1.3 KiB
YAML

language: c
sudo: false
before_install:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install glib cmocka; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./install-cmocka-linux.sh; fi
script:
- if [[ $CC == *"x86_64"* ]]; then ./make.sh cross-win64; elif [[ $CC == *"i686"* ]]; then ./make.sh cross-win32; else ./make.sh && make test; fi
# TODO make bindings enabled
# - ./make.sh && make test && make bindings
# TODO make universal build
# - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew remove glib && brew install glib --universal && make clean && ./make.sh macos-universal && make test; fi
# TODO test iOS builds
# - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then make clean && ./make.sh ios; fi
compiler:
- clang
- gcc
# TODO update mingw32 to gcc 4.7+ for compilation
# - i686-w64-mingw32-gcc
# - x86_64-w64-mingw32-gcc
os:
- linux
- osx
#matrix:
# exclude:
# - os: osx
# compiler: i686-w64-mingw32-gcc
# - os: osx
# compiler: x86_64-w64-mingw32-gcc
addons:
apt:
packages:
- mingw-w64
- gcc-mingw-w64
- mingw-w64-dev
- gcc-mingw-w64-i686
- gcc-mingw-w64-x86-64
- binutils-mingw-w64-i686
- binutils-mingw-w64-x86-64
# TODO are mingw32 builds necessary?
# - mingw32
# - mingw32-binutils
# - mingw32-runtime