2016-03-15 19:23:49 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
if [[ $DOCKER ]]; then
|
2017-10-11 11:13:24 +02:00
|
|
|
docker run \
|
|
|
|
--privileged \
|
|
|
|
-v "$PWD:/outside" \
|
|
|
|
-e "QUTE_BDD_WEBENGINE=$QUTE_BDD_WEBENGINE" \
|
|
|
|
-e "DOCKER=$DOCKER" \
|
|
|
|
-e "CI=$CI" \
|
|
|
|
-e "TRAVIS=$TRAVIS" \
|
|
|
|
"qutebrowser/travis:$DOCKER"
|
2017-09-10 13:17:21 +02:00
|
|
|
elif [[ $TESTENV == eslint ]]; then
|
2017-10-11 11:13:24 +02:00
|
|
|
# Can't run this via tox as we can't easily install tox in the javascript
|
|
|
|
# travis env
|
2017-09-10 13:17:21 +02:00
|
|
|
cd qutebrowser/javascript || exit 1
|
2017-09-29 22:29:18 +02:00
|
|
|
eslint --color --report-unused-disable-directives .
|
2017-12-02 19:22:14 +01:00
|
|
|
elif [[ $TESTENV == shellcheck ]]; then
|
2017-12-04 18:29:55 +01:00
|
|
|
SCRIPTS=$( mktemp )
|
|
|
|
find scripts/dev/ -name '*.sh' >"$SCRIPTS"
|
|
|
|
find misc/userscripts/ -type f -exec grep -lE '[/ ][bd]ash$|[/ ]sh$|[/ ]ksh$' {} + >>"$SCRIPTS"
|
|
|
|
mapfile -t scripts <"$SCRIPTS"
|
|
|
|
rm -f "$SCRIPTS"
|
2017-12-02 19:22:14 +01:00
|
|
|
docker run \
|
|
|
|
-v "$PWD:/outside" \
|
2017-12-04 18:15:02 +01:00
|
|
|
-w /outside \
|
2017-12-03 09:29:38 +01:00
|
|
|
koalaman/shellcheck:latest "${scripts[@]}"
|
2016-03-15 19:23:49 +01:00
|
|
|
else
|
2016-03-16 06:22:36 +01:00
|
|
|
args=()
|
2017-12-12 06:45:47 +01:00
|
|
|
[[ $TRAVIS_OS_NAME == osx ]] && args=('--qute-bdd-webengine' '--no-xvfb' 'tests/unit')
|
2016-03-16 06:22:36 +01:00
|
|
|
|
2017-09-10 13:21:03 +02:00
|
|
|
tox -e "$TESTENV" -- "${args[@]}"
|
2016-03-15 19:23:49 +01:00
|
|
|
fi
|