Skip to content

Instantly share code, notes, and snippets.

@kvu787
Last active February 23, 2016 19:26
Show Gist options
  • Save kvu787/140bb678035756a3f232 to your computer and use it in GitHub Desktop.
Save kvu787/140bb678035756a3f232 to your computer and use it in GitHub Desktop.
# usage: bash gotest.sh <directory to put test results in> <count>
#
# example:
# cd ~/452-labs/src/paxos
# bash gotest.sh testdir 10
#
# to kill a gotest.sh, run:
# ctrl-z (pause process)
# kill %% (kill most recently paused process)
if [ -e "$1" ]; then
echo "$1 already exists"
exit 1
fi
mkdir $1
echo -n > "$1/SUMMARY"
for v in $(seq -w 1 $2);
do
go test >"$1/$v.log" 2>&1
if [ $? -eq '0' ]; then
echo "$v success"
echo "$v success" >> "$1/SUMMARY"
else
echo "$v fail"
echo "$v fail" >> "$1/SUMMARY"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment