2018-03-09 08:45:23 +01:00
|
|
|
language: C
|
|
|
|
matrix:
|
|
|
|
include:
|
|
|
|
- os: linux
|
2018-03-17 19:33:48 +01:00
|
|
|
sudo: false
|
2018-03-09 08:45:23 +01:00
|
|
|
compiler: gcc
|
|
|
|
before_script:
|
|
|
|
- pip install --user cpp-coveralls
|
|
|
|
after_success:
|
|
|
|
- coveralls --build-root build --include src --include tests --gcov-options '\-lp'
|
2018-03-09 09:03:03 +01:00
|
|
|
- os: linux
|
2018-03-17 19:33:48 +01:00
|
|
|
sudo: required # to prevent fail of executables build with clang and sanitizers
|
2018-03-09 09:03:03 +01:00
|
|
|
compiler: clang
|
2018-03-18 17:27:09 +01:00
|
|
|
env: CC=clang
|
2018-03-31 12:33:37 +02:00
|
|
|
|
2018-03-18 17:27:09 +01:00
|
|
|
# Linux / GCC
|
|
|
|
- os: linux
|
|
|
|
sudo: false
|
|
|
|
compiler: gcc
|
|
|
|
env:
|
|
|
|
- FORT_C_COMPILER=gcc-4.9
|
|
|
|
- FORT_CXX_COMPILER=g++-4.9
|
|
|
|
addons:
|
|
|
|
apt:
|
|
|
|
sources: ['ubuntu-toolchain-r-test']
|
|
|
|
packages: ['g++-4.9']
|
|
|
|
|
|
|
|
- os: linux
|
|
|
|
sudo: false
|
|
|
|
compiler: gcc
|
|
|
|
env:
|
|
|
|
- FORT_C_COMPILER=gcc-5
|
|
|
|
- FORT_CXX_COMPILER=g++-5
|
|
|
|
addons:
|
|
|
|
apt:
|
|
|
|
sources: ['ubuntu-toolchain-r-test']
|
|
|
|
packages: ['g++-5']
|
|
|
|
|
|
|
|
- os: linux
|
|
|
|
sudo: false
|
|
|
|
compiler: gcc
|
|
|
|
env:
|
|
|
|
- FORT_C_COMPILER=gcc-6
|
|
|
|
- FORT_CXX_COMPILER=g++-6
|
|
|
|
addons:
|
|
|
|
apt:
|
|
|
|
sources: ['ubuntu-toolchain-r-test']
|
|
|
|
packages: ['g++-6']
|
|
|
|
|
|
|
|
- os: linux
|
|
|
|
sudo: required
|
|
|
|
compiler: gcc
|
|
|
|
env:
|
|
|
|
- FORT_C_COMPILER=gcc-7
|
|
|
|
- FORT_CXX_COMPILER=g++-7
|
|
|
|
addons:
|
|
|
|
apt:
|
|
|
|
sources: ['ubuntu-toolchain-r-test']
|
|
|
|
packages: ['g++-7']
|
2018-05-09 12:29:29 +02:00
|
|
|
|
2018-09-01 19:22:39 +02:00
|
|
|
- os: linux
|
|
|
|
sudo: required
|
|
|
|
compiler: gcc
|
|
|
|
env:
|
|
|
|
- FORT_C_COMPILER=gcc-8
|
|
|
|
- FORT_CXX_COMPILER=g++-8
|
|
|
|
addons:
|
|
|
|
apt:
|
|
|
|
sources: ['ubuntu-toolchain-r-test']
|
2018-11-18 08:10:57 +01:00
|
|
|
packages: ['g++-8', 'cppcheck']
|
2018-05-09 12:29:29 +02:00
|
|
|
|
|
|
|
# OSX / Clang
|
|
|
|
- os: osx
|
|
|
|
osx_image: xcode7.3
|
|
|
|
env: CC=clang
|
|
|
|
|
|
|
|
- os: osx
|
|
|
|
osx_image: xcode8.3
|
|
|
|
env: CC=clang
|
|
|
|
|
|
|
|
- os: osx
|
|
|
|
osx_image: xcode9.3
|
|
|
|
env: CC=clang
|
2018-03-17 19:33:48 +01:00
|
|
|
|
|
|
|
|
2018-03-09 08:45:23 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
script:
|
2018-11-17 22:04:46 +01:00
|
|
|
# Check library file was generated
|
|
|
|
- python amalgamate.py -o dummy.c
|
2018-11-18 07:27:14 +01:00
|
|
|
- wc dummy.c
|
|
|
|
- wc lib/fort.c
|
2018-11-17 22:04:46 +01:00
|
|
|
- diff dummy.c lib/fort.c
|
|
|
|
- rm dummy.c
|
|
|
|
|
2018-03-18 17:27:09 +01:00
|
|
|
# make sure CC is correctly set
|
|
|
|
- if [[ "${FORT_C_COMPILER}" != "" ]];
|
|
|
|
then
|
|
|
|
export CC=${FORT_C_COMPILER};
|
|
|
|
export CXX=${FORT_CXX_COMPILER};
|
|
|
|
fi
|
|
|
|
|
2018-11-18 08:10:57 +01:00
|
|
|
# cppcheck run
|
2018-11-18 08:30:47 +01:00
|
|
|
- |
|
|
|
|
if [ "${FORT_C_COMPILER}" = "gcc-8" ]; then
|
2018-11-18 09:32:07 +01:00
|
|
|
cppcheck --std=posix --enable=warning,style,performance,portability,information,missingInclude --error-exitcode=1 lib
|
|
|
|
cppcheck --std=c89 --enable=warning,style,performance,portability,information,missingInclude --error-exitcode=1 lib
|
|
|
|
cppcheck --std=c99 --enable=warning,style,performance,portability,information,missingInclude --error-exitcode=1 lib
|
|
|
|
cppcheck --std=c++11 --enable=warning,style,performance,portability,information,missingInclude --error-exitcode=1 lib
|
2018-11-18 08:10:57 +01:00
|
|
|
fi
|
|
|
|
|
2018-03-09 08:45:23 +01:00
|
|
|
# Print all environment variables to aid in CI development
|
|
|
|
- printenv
|
|
|
|
# Print version and available CMake generators to aid in CI development
|
|
|
|
- cmake --version
|
|
|
|
|
2018-03-09 09:03:03 +01:00
|
|
|
# Perform out-of-source build(CMake backend generation, build, and test)
|
2018-03-18 17:02:53 +01:00
|
|
|
# Test build without optimizations and with asan
|
2018-03-09 09:03:03 +01:00
|
|
|
- mkdir -p build
|
|
|
|
- cd build
|
2018-03-18 17:02:53 +01:00
|
|
|
- cmake .. -DFORT_BUILD_TYPE=asan
|
2018-03-09 09:03:03 +01:00
|
|
|
- cmake --build . --target all
|
|
|
|
- ls
|
2018-03-17 19:36:24 +01:00
|
|
|
- ./libfort_example
|
2018-05-06 15:21:45 +02:00
|
|
|
- ./libfort_test_dev
|
2018-03-17 19:36:24 +01:00
|
|
|
- ./libfort_test
|
2018-03-09 09:03:03 +01:00
|
|
|
|
2018-11-16 19:16:05 +01:00
|
|
|
# Test without WCHAR support
|
|
|
|
- cd ..
|
|
|
|
- rm -r build/*
|
|
|
|
- mkdir -p build
|
|
|
|
- cd build
|
|
|
|
- cmake .. -DFORT_ENABLE_WCHAR=OFF
|
|
|
|
- cmake --build . --target all
|
|
|
|
- ls
|
|
|
|
- ./libfort_example
|
|
|
|
- ./libfort_test_dev
|
|
|
|
- ./libfort_test
|
|
|
|
|
2018-03-18 17:02:53 +01:00
|
|
|
# Test build without optimizations and with ubsan
|
2018-03-31 12:33:37 +02:00
|
|
|
- |
|
|
|
|
if [ "${CC}" = 'gcc-7' ]; then
|
|
|
|
cd .. ;
|
|
|
|
rm -r build/* ;
|
|
|
|
cd build ;
|
|
|
|
cmake .. -DFORT_BUILD_TYPE=ubsan ;
|
|
|
|
cmake --build . --target all ;
|
|
|
|
ls ;
|
|
|
|
./libfort_example ;
|
2018-05-06 15:21:45 +02:00
|
|
|
./libfort_test_dev ;
|
2018-03-31 12:33:37 +02:00
|
|
|
./libfort_test ;
|
2018-03-18 17:27:09 +01:00
|
|
|
fi
|
2018-03-18 17:02:53 +01:00
|
|
|
|
2018-03-31 12:33:37 +02:00
|
|
|
# Astyle Format
|
|
|
|
- |
|
|
|
|
if [ "${CC}" = 'gcc' ]; then
|
|
|
|
ls
|
|
|
|
cd .. ;
|
|
|
|
rm -r build/* ;
|
|
|
|
cd build ;
|
|
|
|
cmake .. -DFORT_ENABLE_ASTYLE=ON ;
|
|
|
|
make ;
|
|
|
|
make format ;
|
|
|
|
cd .. ;
|
|
|
|
if [[ -n $(git diff) ]]; then
|
|
|
|
echo "You must run make format before submitting a pull request" ;
|
|
|
|
echo "" ;
|
|
|
|
git diff ;
|
|
|
|
exit -1 ;
|
|
|
|
fi
|
|
|
|
cd build ;
|
2018-03-31 15:44:45 +02:00
|
|
|
rm -rf external
|
2018-03-18 13:32:02 +01:00
|
|
|
fi
|
2018-03-31 12:33:37 +02:00
|
|
|
|
|
|
|
|
|
|
|
# Clang static analyzer
|
|
|
|
- |
|
|
|
|
if [ "${CC}" = 'clang' ]; then
|
|
|
|
cd .. ;
|
|
|
|
pwd ;
|
|
|
|
ls ;
|
|
|
|
rm -rf build/* ;
|
|
|
|
cd build ;
|
|
|
|
cmake .. ;
|
|
|
|
scan-build make ;
|
|
|
|
fi
|
|
|
|
|
2018-03-31 15:40:59 +02:00
|
|
|
# Build for coveralls (should be the last)
|
|
|
|
- |
|
|
|
|
if [ "${CC}" = 'gcc' ]; then
|
|
|
|
cd .. ;
|
|
|
|
rm -r build/* ;
|
|
|
|
cd build ;
|
|
|
|
cmake .. -DFORT_BUILD_TYPE=coveralls ;
|
|
|
|
cmake --build . --target all ;
|
|
|
|
ls ;
|
2018-05-06 15:21:45 +02:00
|
|
|
./libfort_test_dev ;
|
2018-03-31 15:40:59 +02:00
|
|
|
fi
|
|
|
|
- cd ..
|
|
|
|
|
2018-03-09 09:03:03 +01:00
|
|
|
|
2018-03-18 17:02:53 +01:00
|
|
|
|
|
|
|
|
2018-11-17 22:04:46 +01:00
|
|
|
|
|
|
|
|