2013-10-04 18:21:30 -04:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2014-05-13 19:12:52 -04:00
|
|
|
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
2013-10-04 18:21:30 -04:00
|
|
|
|
2015-02-12 07:24:44 -05:00
|
|
|
function usage {
|
|
|
|
echo "Usage: $0 [--skip-build]"
|
|
|
|
exit 0
|
|
|
|
}
|
2014-05-21 16:54:31 -04:00
|
|
|
|
2014-07-03 20:17:23 -04:00
|
|
|
flake8 --select=F,C9 --max-complexity=10 "${SCRIPT_DIR}/python"
|
2015-02-12 07:24:44 -05:00
|
|
|
skip_build=false
|
|
|
|
|
|
|
|
for flag in $@; do
|
|
|
|
case "$flag" in
|
|
|
|
--skip-build)
|
|
|
|
skip_build=true
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
usage
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
|
|
|
if ! $skip_build; then
|
|
|
|
"${SCRIPT_DIR}/third_party/ycmd/build.py"
|
|
|
|
fi
|
2013-10-04 18:21:30 -04:00
|
|
|
|
2014-07-03 20:17:23 -04:00
|
|
|
for directory in "${SCRIPT_DIR}"/third_party/*; do
|
2013-10-04 18:21:30 -04:00
|
|
|
if [ -d "${directory}" ]; then
|
2014-05-13 19:12:52 -04:00
|
|
|
export PYTHONPATH=${directory}:$PYTHONPATH
|
2013-10-04 18:21:30 -04:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2014-05-14 14:07:10 -04:00
|
|
|
|
2014-07-03 20:17:23 -04:00
|
|
|
for directory in "${SCRIPT_DIR}"/third_party/ycmd/third_party/*; do
|
2014-05-14 14:07:10 -04:00
|
|
|
if [ -d "${directory}" ]; then
|
|
|
|
export PYTHONPATH=${directory}:$PYTHONPATH
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2014-07-03 20:17:23 -04:00
|
|
|
nosetests -v "${SCRIPT_DIR}/python"
|