2016-03-01 08:49:27 +03:00
|
|
|
language: c
|
2019-07-31 07:34:49 +03:00
|
|
|
env:
|
|
|
|
- PATH=$PATH:/usr/local/opt/binutils/bin
|
2016-03-01 08:49:27 +03:00
|
|
|
script:
|
2020-04-20 19:47:08 +03:00
|
|
|
- |
|
|
|
|
if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then
|
|
|
|
choco install cygwin cyg-get && \
|
|
|
|
cyg-get.bat default autoconf automake make gcc-core clang pkg-config libpcre-devel cmake python27-setuptools ruby wget && \
|
|
|
|
export SHELLOPTS && set -o igncr \
|
|
|
|
cmd.exe //C "C:\\tools\\cygwin\\bin\\bash.exe -lc 'cd /cygdrive/$TRAVIS_BUILD_DIR; make; ./install-cmocka-linux.sh; export PATH="$PATH":/cygdrive/$TRAVIS_BUILD_DIR:/cygdrive/$TRAVIS_BUILD_DIR/cmocka/src; make test'"
|
|
|
|
else
|
|
|
|
make && make -C bindings/go && make -C bindings/go test && make test
|
|
|
|
fi
|
2016-03-01 08:49:27 +03:00
|
|
|
compiler:
|
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-21 19:21:10 +03:00
|
|
|
- clang
|
|
|
|
- gcc
|
2016-03-03 18:14:25 +03:00
|
|
|
os:
|
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-21 19:21:10 +03:00
|
|
|
- linux
|
|
|
|
- osx
|
2020-04-20 19:47:08 +03:00
|
|
|
- windows
|
2017-03-12 05:04:27 +03:00
|
|
|
matrix:
|
2020-04-20 19:47:08 +03:00
|
|
|
fast_finish: true
|
2017-03-12 05:04:27 +03:00
|
|
|
include:
|
2020-04-20 19:47:08 +03:00
|
|
|
- name: "Linux 32bit"
|
2019-09-07 06:25:13 +03:00
|
|
|
os: linux
|
2019-01-02 04:45:13 +03:00
|
|
|
compiler: gcc
|
2020-04-26 12:52:22 +03:00
|
|
|
env:
|
|
|
|
- CFLAGS="-m32" LDFLAGS="-m32" LDFLAGS_STATIC="-m32" UNICORN_QEMU_FLAGS="--cpu=i386"
|
|
|
|
- PATH=$PATH:/usr/local/opt/binutils/bin
|
2019-01-02 04:45:13 +03:00
|
|
|
script: make && make -C tests/unit test && make -C tests/regress test
|
2019-02-28 20:09:41 +03:00
|
|
|
addons:
|
|
|
|
apt:
|
|
|
|
packages:
|
|
|
|
- lib32ncurses5-dev
|
|
|
|
- lib32z1-dev
|
|
|
|
- libpthread-stubs0-dev
|
|
|
|
- lib32gcc-4.8-dev
|
|
|
|
- libc6-dev-i386
|
|
|
|
- gcc-multilib
|
|
|
|
- libcmocka-dev:i386
|
2020-04-20 19:47:08 +03:00
|
|
|
|
2020-04-26 12:52:22 +03:00
|
|
|
- name: "Linux Cmake 32bit"
|
|
|
|
os: linux
|
|
|
|
compiler: gcc
|
|
|
|
env:
|
|
|
|
- CFLAGS="-m32" LDFLAGS="-m32" LDFLAGS_STATIC="-m32" UNICORN_QEMU_FLAGS="--cpu=i386"
|
|
|
|
- PATH=$PATH:/usr/local/opt/binutils/bin
|
|
|
|
script:
|
|
|
|
- ./cmake.sh x86
|
|
|
|
- make -C tests/unit test && make -C tests/regress test
|
|
|
|
addons:
|
|
|
|
apt:
|
|
|
|
packages:
|
|
|
|
- lib32ncurses5-dev
|
|
|
|
- lib32z1-dev
|
|
|
|
- libpthread-stubs0-dev
|
|
|
|
- lib32gcc-4.8-dev
|
|
|
|
- libc6-dev-i386
|
|
|
|
- gcc-multilib
|
|
|
|
- libcmocka-dev:i386
|
|
|
|
|
|
|
|
- name: "Linux Cmake 64bit"
|
|
|
|
os: linux
|
|
|
|
compiler: gcc
|
|
|
|
env:
|
|
|
|
- PATH=$PATH:/usr/local/opt/binutils/bin
|
|
|
|
script:
|
|
|
|
- ./cmake.sh
|
|
|
|
- make -C tests/unit test && make tests/regress test
|
|
|
|
|
2020-04-20 19:47:08 +03:00
|
|
|
- name: "MacOSX brew"
|
2017-10-07 18:56:02 +03:00
|
|
|
os: osx
|
2020-04-20 19:47:08 +03:00
|
|
|
osx_image: xcode10.1
|
|
|
|
python: 3.7
|
|
|
|
before_cache:
|
|
|
|
- brew cleanup
|
|
|
|
- find /usr/local/Homebrew \! -regex ".+\.git.+" -delete;
|
|
|
|
cache:
|
|
|
|
directories:
|
|
|
|
- $HOME/Library/Caches/Homebrew
|
|
|
|
- /usr/local/Homebrew
|
|
|
|
before_install:
|
|
|
|
- cd /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core && git stash && git clean -d -f
|
|
|
|
script:
|
|
|
|
- brew install --HEAD unicorn
|
|
|
|
- brew test unicorn
|
|
|
|
|
|
|
|
- name: "Windows nmake 32bit"
|
|
|
|
os: windows
|
|
|
|
language: shell
|
|
|
|
script:
|
|
|
|
- mkdir build
|
|
|
|
- cd build
|
|
|
|
- cmd.exe //C 'C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvarsall.bat' x86 '&' cmd.exe //C '..\nmake.bat' x86
|
|
|
|
|
|
|
|
- name: "Windows nmake 64bit"
|
|
|
|
os: windows
|
|
|
|
language: shell
|
|
|
|
script:
|
|
|
|
- mkdir build
|
|
|
|
- cd build
|
|
|
|
- cmd.exe //C 'C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvarsall.bat' amd64 '&' cmd.exe //C '..\nmake.bat'
|
|
|
|
|
|
|
|
- name: "Windows MSVC 32bit"
|
|
|
|
os: windows
|
|
|
|
language: shell
|
|
|
|
env:
|
|
|
|
- MSBUILD_PATH="C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin"
|
|
|
|
script:
|
|
|
|
- PATH=$MSBUILD_PATH:$PATH
|
|
|
|
- cmd.exe //C 'msbuild.exe msvc/unicorn.sln /m:2 /nologo /p:Configuration=Release /p:Platform=Win32'
|
|
|
|
|
|
|
|
- name: "Windows MSVC 64bit"
|
|
|
|
os: windows
|
|
|
|
language: shell
|
|
|
|
env:
|
|
|
|
- MSBUILD_PATH="C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin"
|
|
|
|
script:
|
|
|
|
- PATH=$MSBUILD_PATH:$PATH
|
|
|
|
- cmd.exe //C 'msbuild.exe msvc/unicorn.sln /m:2 /nologo /p:Configuration=Release /p:Platform=x64'
|
|
|
|
|
|
|
|
- name: "Windows MSYS2/MinGW32"
|
|
|
|
os: windows
|
|
|
|
language: shell
|
|
|
|
env:
|
|
|
|
- PATH=/C/tools/msys64/mingw32/bin:$PATH
|
|
|
|
before_install:
|
|
|
|
- |
|
|
|
|
if [[ ! -f /C/tools/msys64/msys2_shell.cmd ]]; then
|
|
|
|
rm -rf /C/tools/msys64
|
|
|
|
fi
|
|
|
|
- choco uninstall -y mingw
|
|
|
|
- choco upgrade --no-progress -y msys2
|
|
|
|
- export msys2='cmd //C RefreshEnv.cmd '
|
|
|
|
- export msys2+='& set MSYS=winsymlinks:nativestrict '
|
|
|
|
- export msys2+='& C:\\tools\\msys64\\msys2_shell.cmd -defterm -no-start'
|
|
|
|
- export shell="$msys2 -mingw32 -full-path -here -c \$\* --"
|
|
|
|
- export msys2+=" -msys2 -c \$\* --"
|
|
|
|
- $msys2 pacman --sync --noconfirm --needed \
|
|
|
|
autoconf \
|
|
|
|
automake \
|
|
|
|
make \
|
|
|
|
perl \
|
|
|
|
python \
|
|
|
|
mingw-w64-i686-libtool \
|
|
|
|
mingw-w64-i686-toolchain \
|
|
|
|
mingw-w64-i686-gcc \
|
|
|
|
mingw-w64-i686-cmake \
|
|
|
|
mingw-w64-i686-cmocka \
|
|
|
|
mingw-w64-i686-python3-setuptools \
|
|
|
|
unzip
|
|
|
|
- export CPPFLAGS=-D__USE_MINGW_ANSI_STDIO=1
|
|
|
|
- export CC=i686-w64-mingw32-gcc
|
|
|
|
- export AR=gcc-ar
|
|
|
|
- export RANLIB=gcc-ranlib
|
|
|
|
- export CFLAGS="-m32"
|
|
|
|
- export LDFLAGS="-m32"
|
|
|
|
- export LDFLAGS_STATIC="-m32"
|
|
|
|
- export UNICORN_QEMU_FLAGS="--cpu=i386"
|
|
|
|
before_cache:
|
|
|
|
- $msys2 pacman --sync --clean --noconfirm
|
|
|
|
cache:
|
|
|
|
directories:
|
|
|
|
- $HOME/AppData/Local/Temp/chocolatey
|
|
|
|
- /C/tools/msys64
|
|
|
|
script:
|
|
|
|
- $shell make; cp unicorn.dll /C/Windows/SysWOW64/; $shell make test
|
|
|
|
|
|
|
|
- name: "Windows MSYS2/MinGW64"
|
|
|
|
os: windows
|
|
|
|
language: shell
|
|
|
|
env:
|
|
|
|
- PATH=/C/tools/msys64/mingw64/bin:$PATH
|
|
|
|
before_install:
|
|
|
|
- |
|
|
|
|
if [[ ! -f /C/tools/msys64/msys2_shell.cmd ]]; then
|
|
|
|
rm -rf /C/tools/msys64
|
|
|
|
fi
|
|
|
|
- choco uninstall -y mingw
|
|
|
|
- choco upgrade --no-progress -y msys2
|
|
|
|
- export msys2='cmd //C RefreshEnv.cmd '
|
|
|
|
- export msys2+='& set MSYS=winsymlinks:nativestrict '
|
|
|
|
- export msys2+='& C:\\tools\\msys64\\msys2_shell.cmd -defterm -no-start'
|
|
|
|
- export shell="$msys2 -mingw64 -full-path -here -c \$\* --"
|
|
|
|
- export msys2+=" -msys2 -c \$\* --"
|
|
|
|
- $msys2 pacman --sync --noconfirm --needed \
|
|
|
|
autoconf \
|
|
|
|
automake \
|
|
|
|
make \
|
|
|
|
perl \
|
|
|
|
python \
|
|
|
|
mingw-w64-x86_64-libtool \
|
|
|
|
mingw-w64-x86_64-toolchain \
|
|
|
|
mingw-w64-x86_64-cmake \
|
|
|
|
mingw-w64-x86_64-cmocka \
|
|
|
|
mingw-w64-x86_64-python3-setuptools
|
|
|
|
unzip
|
|
|
|
- export CPPFLAGS=-D__USE_MINGW_ANSI_STDIO=1
|
|
|
|
- export CC=x86_64-w64-mingw32-gcc
|
|
|
|
- export AR=gcc-ar
|
|
|
|
- export RANLIB=gcc-ranlib
|
|
|
|
before_cache:
|
|
|
|
- $msys2 pacman --sync --clean --noconfirm
|
|
|
|
cache:
|
|
|
|
directories:
|
|
|
|
- $HOME/AppData/Local/Temp/chocolatey
|
|
|
|
- /C/tools/msys64
|
|
|
|
script:
|
|
|
|
- $shell make; cp unicorn.dll /C/Windows/System32/; $shell make test
|
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-21 19:21:10 +03:00
|
|
|
addons:
|
2019-01-02 04:45:13 +03:00
|
|
|
apt:
|
|
|
|
packages:
|
|
|
|
- libpthread-stubs0-dev
|
2019-08-11 12:47:36 +03:00
|
|
|
- libcmocka-dev
|
2018-11-19 18:51:58 +03:00
|
|
|
homebrew:
|
2019-07-31 07:34:49 +03:00
|
|
|
update: true
|
2018-11-19 18:51:58 +03:00
|
|
|
brewfile: true
|