2016-06-18 05:01:08 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e -x -o pipefail
|
|
|
|
|
2017-06-30 01:30:25 +00:00
|
|
|
DUB_FLAGS=${DUB_FLAGS:-}
|
|
|
|
|
2017-07-02 21:54:00 +00:00
|
|
|
# Check for trailing whitespace"
|
|
|
|
grep -nrI --include='*.d' '\s$' . && (echo "Trailing whitespace found"; exit 1)
|
|
|
|
|
2016-06-18 05:01:08 +00:00
|
|
|
# test for successful release build
|
2017-06-30 01:30:25 +00:00
|
|
|
dub build -b release --compiler=$DC -c $CONFIG $DUB_FLAGS
|
2016-06-18 05:01:08 +00:00
|
|
|
|
|
|
|
# test for successful 32-bit build
|
|
|
|
if [ "$DC" == "dmd" ]; then
|
2017-06-30 01:30:25 +00:00
|
|
|
dub build --arch=x86 -c $CONFIG $DUB_FLAGS
|
2016-06-18 05:01:08 +00:00
|
|
|
fi
|
|
|
|
|
2017-06-30 01:30:25 +00:00
|
|
|
dub test --compiler=$DC -c $CONFIG $DUB_FLAGS
|
2016-06-18 05:01:08 +00:00
|
|
|
|
|
|
|
if [ ${BUILD_EXAMPLE=1} -eq 1 ]; then
|
|
|
|
for ex in $(\ls -1 examples/); do
|
|
|
|
echo "[INFO] Building example $ex"
|
2020-05-25 09:37:33 +00:00
|
|
|
(cd examples/$ex && dub build --compiler=$DC --override-config vibe-core/$CONFIG && dub clean)
|
2016-06-18 05:01:08 +00:00
|
|
|
done
|
|
|
|
fi
|
|
|
|
if [ ${RUN_TEST=1} -eq 1 ]; then
|
2016-10-24 07:21:11 +00:00
|
|
|
for ex in `\ls -1 tests/*.d`; do
|
2019-10-22 13:22:28 +00:00
|
|
|
script="${ex%.d}.sh"
|
2017-02-16 23:49:40 +00:00
|
|
|
if [ -e "$script" ]; then
|
|
|
|
echo "[INFO] Running test scipt $script"
|
|
|
|
(cd tests && "./${script:6}")
|
|
|
|
else
|
|
|
|
echo "[INFO] Running test $ex"
|
2020-05-25 09:37:33 +00:00
|
|
|
dub --temp-build --compiler=$DC --single $ex --override-config vibe-core/$CONFIG
|
2017-02-16 23:49:40 +00:00
|
|
|
fi
|
2016-06-18 05:01:08 +00:00
|
|
|
done
|
|
|
|
fi
|