Travis CI config file & related required changes

This commit is contained in:
Strahinja Val Markovic 2013-04-18 21:26:06 -07:00
parent 12c1583ecf
commit 484c5f7241
3 changed files with 34 additions and 2 deletions

8
.travis.yml Normal file
View File

@ -0,0 +1,8 @@
language: cpp
compiler:
- gcc
- clang
script: ./install.sh
env:
- YCM_TESTRUN=1 EXTRA_CMAKE_ARGS=""
- YCM_TESTRUN=1 EXTRA_CMAKE_ARGS="-DUSE_CLANG_COMPLETER=ON"

View File

@ -41,7 +41,11 @@ endif()
if ( CMAKE_CXX_COMPILER_ID STREQUAL "Clang" ) if ( CMAKE_CXX_COMPILER_ID STREQUAL "Clang" )
set( COMPILER_IS_CLANG true ) set( COMPILER_IS_CLANG true )
# The Travis CI build machines don't have libc++ installed
if ( NOT DEFINED ENV{TRAVIS} )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++" ) set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++" )
endif()
endif() endif()
if ( CMAKE_GENERATOR STREQUAL Xcode ) if ( CMAKE_GENERATOR STREQUAL Xcode )

View File

@ -82,6 +82,20 @@ function install {
rm -rf $build_dir rm -rf $build_dir
} }
function testrun {
ycm_dir=`pwd`
build_dir=`mktemp -d -t ycm_build.XXXXXX`
pushd $build_dir
cmake -G "Unix Makefiles" $1 . $ycm_dir/cpp
make -j $(num_cores) ycm_core_tests
cd ycm/tests
LD_LIBRARY_PATH=$ycm_dir/python ./ycm_core_tests
popd
rm -rf $build_dir
}
function linux_cmake_install { function linux_cmake_install {
echo "Please install CMake using your package manager and retry." echo "Please install CMake using your package manager and retry."
exit 1 exit 1
@ -112,4 +126,10 @@ if ! command_exists cmake; then
echo "CMake is required to build YouCompleteMe." echo "CMake is required to build YouCompleteMe."
cmake_install cmake_install
fi fi
install $cmake_args
if [ -z "$YCM_TESTRUN" ]; then
install $cmake_args $EXTRA_CMAKE_ARGS
else
testrun $cmake_args $EXTRA_CMAKE_ARGS
fi