2017-10-13 12:02:10 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# Kill all subshells with ctrl-c
|
|
|
|
trap "kill 0" SIGINT
|
|
|
|
|
|
|
|
reset='\033[0m'
|
|
|
|
red='\033[0;31m'
|
2017-10-13 12:34:15 +00:00
|
|
|
green='\033[0;32m'
|
|
|
|
blue='\033[0;34m'
|
2017-10-13 12:02:10 +00:00
|
|
|
|
|
|
|
EXIT=0
|
|
|
|
|
2017-10-13 12:34:15 +00:00
|
|
|
SUMMARY="$blue##\n## SUMMARY\n##$reset\n\n"
|
|
|
|
|
2020-04-12 22:32:06 +00:00
|
|
|
TOOL=$1
|
|
|
|
|
2017-10-13 12:02:10 +00:00
|
|
|
for env in test-environments/*; do
|
|
|
|
name=$(basename "$env")
|
2020-04-12 22:32:06 +00:00
|
|
|
|
|
|
|
if [[ -n $TOOL ]]; then
|
|
|
|
if [[ $name == bundle* ]]; then
|
|
|
|
if [[ $TOOL != 'clj' ]]; then
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
if [[ $TOOL != 'lein' ]]; then
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2017-10-13 12:02:10 +00:00
|
|
|
echo -e "$blue##"
|
|
|
|
echo -e "## TESTING $name"
|
|
|
|
echo -e "##$reset"
|
|
|
|
echo
|
2018-04-03 07:33:01 +00:00
|
|
|
$env/test.sh
|
2017-10-13 13:42:25 +00:00
|
|
|
if [[ $? != "0" ]]; then
|
2017-10-13 12:02:10 +00:00
|
|
|
echo
|
2017-10-13 12:34:15 +00:00
|
|
|
echo -e "${red}FAIL $name$reset"
|
|
|
|
SUMMARY="$SUMMARY${red}FAIL $name$reset\n"
|
2017-10-13 12:02:10 +00:00
|
|
|
EXIT=1
|
2017-10-13 12:34:15 +00:00
|
|
|
else
|
|
|
|
SUMMARY="$SUMMARY${green}OK $name$reset\n"
|
2017-10-13 12:02:10 +00:00
|
|
|
fi
|
|
|
|
echo
|
|
|
|
echo
|
|
|
|
done
|
|
|
|
|
2017-10-13 12:34:15 +00:00
|
|
|
echo -e "$SUMMARY"
|
|
|
|
|
2017-10-13 12:02:10 +00:00
|
|
|
exit $EXIT
|