blob: 096736f259500ab28cd5f7c34ebfa1280c86d948 [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 II704a7502013-07-10 15:23:43 -070026LIBS=$(ls $ACCEPTANCE/lib*.go)
Samuel A. Falvo II1d3fa662013-06-25 15:29:32 -070027for T in $(ls -1 $ACCEPTANCE/[0-9][0-9]*.go); do
28 if ! [ -x $T ]; then
Samuel A. Falvo II704a7502013-07-10 15:23:43 -070029 CMD="go run $T $LIBS -quiet"
30 echo "$CMD ..."
31 if ! $CMD ; then
Samuel A. Falvo IId6092ad2013-06-25 14:07:25 -070032 echo "- FAILED. Try re-running w/out the -quiet option to see output."
33 exit 1
34 fi
35 fi
36done
37