Adding a run_tests script
This is now also used by Travis CI.
This commit is contained in:
parent
9747bbc26f
commit
070d39b2a9
@ -7,7 +7,7 @@ install:
|
||||
compiler:
|
||||
- gcc
|
||||
- clang
|
||||
script: flake8 --exclude=jedi --select=F,C9 --max-complexity=10 python && ./install.sh && nosetests python
|
||||
script: ./run_tests.sh
|
||||
env:
|
||||
- YCM_TESTRUN=1 EXTRA_CMAKE_ARGS=""
|
||||
- YCM_TESTRUN=1 EXTRA_CMAKE_ARGS="-DUSE_CLANG_COMPLETER=ON"
|
||||
- USE_CLANG_COMPLETER="true"
|
||||
- USE_CLANG_COMPLETER="false"
|
||||
|
@ -138,7 +138,7 @@ fi
|
||||
if [ -z "$YCM_TESTRUN" ]; then
|
||||
install $cmake_args $EXTRA_CMAKE_ARGS
|
||||
else
|
||||
testrun $cmake_args -DUSE_DEV_FLAGS=ON $EXTRA_CMAKE_ARGS
|
||||
testrun $cmake_args $EXTRA_CMAKE_ARGS
|
||||
fi
|
||||
|
||||
if $omnisharp_completer; then
|
||||
|
@ -360,7 +360,7 @@ struct Foo {
|
||||
def FiletypeCompletionAvailable_Works_test():
|
||||
app = TestApp( ycmd.app )
|
||||
request_data = {
|
||||
'filetypes': ['cpp']
|
||||
'filetypes': ['python']
|
||||
}
|
||||
|
||||
ok_( app.post_json( '/filetype_completion_available',
|
||||
|
46
run_tests.sh
Executable file
46
run_tests.sh
Executable file
@ -0,0 +1,46 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
function usage {
|
||||
echo "Usage: $0 [--no-clang-completer]"
|
||||
exit 0
|
||||
}
|
||||
|
||||
flake8 --select=F,C9 --max-complexity=10 python
|
||||
|
||||
use_clang_completer=true
|
||||
for flag in $@; do
|
||||
case "$flag" in
|
||||
--no-clang-completer)
|
||||
use_clang_completer=false
|
||||
;;
|
||||
*)
|
||||
usage
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ -n "$USE_CLANG_COMPLETER" ]; then
|
||||
use_clang_completer=$USE_CLANG_COMPLETER
|
||||
fi
|
||||
|
||||
if $use_clang_completer; then
|
||||
extra_cmake_args="-DUSE_CLANG_COMPLETER=ON -DUSE_DEV_FLAGS=ON"
|
||||
else
|
||||
extra_cmake_args="-DUSE_DEV_FLAGS=ON"
|
||||
fi
|
||||
|
||||
EXTRA_CMAKE_ARGS=$extra_cmake_args YCM_TESTRUN=1 ./install.sh
|
||||
|
||||
for directory in third_party/*; do
|
||||
if [ -d "${directory}" ]; then
|
||||
export PYTHONPATH=$(realpath ${directory}):$PYTHONPATH
|
||||
fi
|
||||
done
|
||||
|
||||
if $use_clang_completer; then
|
||||
nosetests -v python
|
||||
else
|
||||
nosetests -v --exclude=".*Clang.*" python
|
||||
fi
|
Loading…
Reference in New Issue
Block a user