Last active
July 6, 2016 07:54
-
-
Save O5ten/93d7de2ef062b11210a71a67e012f76a to your computer and use it in GitHub Desktop.
Run testsuite quickly in browser
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
library=$1 | |
suite=$2 | |
coverage=$3 | |
if [ ! -d ui/$library ]; then | |
echo "Directory ui/$library does not exist" | |
exit 1 | |
fi | |
if [[ $coverage == "coverage" ]] || [[ $suite == "coverage" ]]; then | |
echo "Running with coverage turned on" | |
coverage="?coverage=true" | |
fi | |
if [[ $suite == "bit" ]] || [[ $suite == "unit" ]]; then | |
echo "Running" $suite "tests" | |
else | |
echo "Defaulting to unit tests, available test suites: [unit,bit]" | |
suite="unit" | |
fi | |
killall node &> /dev/null | |
cd ui/$library | |
cdt2 serve &> /dev/null & | |
sleep 2 | |
google-chrome --app=http://localhost:8585/test/$suite/$coverage --user-data-dir=/tmp/google-chrome-unittest &> /dev/null & | |
wait $! | |
killall node &> /dev/null |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment