Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Merge pull request #19259 from lightsofapollo/travisactionall
Browse files Browse the repository at this point in the history
Bug 1010530 - Add a binary to run all tests in a travis ci test suite +s...
  • Loading branch information
lightsofapollo committed May 15, 2014
2 parents 40e14cc + b461452 commit 7f809a8
Showing 1 changed file with 61 additions and 0 deletions.
61 changes: 61 additions & 0 deletions bin/ci
@@ -0,0 +1,61 @@
#! /bin/bash

# XXX: At some point we probably don't need travis specific logic but for now
# it's very easy to use this with environment variables to keep everything
# running as it does in travis.

# test suite root for all travis ci hook style tests...
suite_root="tests/travis_ci"

usage() {
echo
echo " Usage: ./bin/ci [command] [args]"
echo
echo " Commands:"
echo
echo " run <suite> - run a particular test suite (use ls to see all suites)"
echo " ls - list all the test suites which can be run"
echo
echo
}

cmd_ls() {
ls $suite_root
}

cmd_run() {
local steps="before_install install before_script script after_script"
local root="$suite_root/$1/"

if [ ! -d $root ] || [ "$1" == "" ] || [ "$1" == " " ];
then
echo "CI suite $1 does not exist in path $root"
echo
echo "Allowed suites:"
echo
echo "$(cmd_ls)"
echo
usage
exit 1
fi

for step in $steps; do
if [ -x "$root/$step" ];
then
eval "$root/$step"
fi
done
}

case "$1" in
"run")
cmd_run ${@:2}
;;
"ls")
cmd_ls
;;
*)
usage
;;
esac

0 comments on commit 7f809a8

Please sign in to comment.