Skip to content

Commit

Permalink
.ci/check_unsupported.sh: Check exit code was 4
Browse files Browse the repository at this point in the history
This brings the bear script into line with the same
script in the coala core repository.
  • Loading branch information
jayvdb committed Jul 23, 2018
1 parent fc8c157 commit 973088a
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions .ci/check_unsupported.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,30 @@ set -x
# Many bear dependencies do not install on unsupported versions
echo "" > bear-requirements.txt

python setup.py install | tee setup.log
python setup.py install 2>&1 | tee setup.log

retval=$?

set +x

# coalib.__init__.py should exit with 4 on unsupported versions of Python
# And setup.py emits something else.
if [[ $retval == 0 ]]; then
echo "Unexpected error code 0"
exit 1
else
echo "setup.py error code $retval ok"
# But bears setup.py sees retval 1.
if [[ $retval != 1 ]]; then
echo "Unexpected error code $retval"

# When the exit code is 0, use a non-zero exit code instead
if [[ $retval == 0 ]]; then
exit 127
fi
exit $retval
fi

# error when no lines selected by grep
set -e

# The following is emitted on stdout
grep -q 'coala supports only python 3.4.4 or later' setup.log
# The following is emitted on stderr
grep -q 'error: Setup script exited with 4' setup.log

echo "Unsupported check completed successfully"

0 comments on commit 973088a

Please sign in to comment.