blob: b78e6068fc79d7c8cf976138cf0fec05a477de38 [file] [log] [blame]
Samuel A. Falvo IId6092ad2013-06-25 14:07:25 -07001#!/bin/bash
2#
3# This script is responsible for executing all the acceptance tests found in
4# the acceptance/ directory.
5
6# Find where _this_ script is running from.
7SCRIPTS=$(dirname $0)
8SCRIPTS=$(cd $SCRIPTS; pwd)
9
10# Locate the acceptance test / examples directory.
11ACCEPTANCE=$(cd $SCRIPTS/../acceptance; pwd)
12
Samuel A. Falvo II1d3fa662013-06-25 15:29:32 -070013# Go workspace path
14WS=$(cd $SCRIPTS/..; pwd)
15
16# In order to run Go code interactively, we need the GOPATH environment
17# to be set.
18if [ "x$GOPATH" == "x" ]; then
19 export GOPATH=$WS
20 echo "WARNING: You didn't have your GOPATH environment variable set."
21 echo " I'm assuming $GOPATH as its value."
22fi
23
Samuel A. Falvo IId6092ad2013-06-25 14:07:25 -070024# Run all acceptance tests sequentially.
25# If any test fails, we fail fast.
Samuel A. Falvo II1d3fa662013-06-25 15:29:32 -070026for T in $(ls -1 $ACCEPTANCE/[0-9][0-9]*.go); do
27 if ! [ -x $T ]; then
28 echo "go run $T -quiet ..."
29 if ! go run $T -quiet ; then
Samuel A. Falvo IId6092ad2013-06-25 14:07:25 -070030 echo "- FAILED. Try re-running w/out the -quiet option to see output."
31 exit 1
32 fi
33 fi
34done
35