This repository has been archived by the owner on Nov 3, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19259 from lightsofapollo/travisactionall
Bug 1010530 - Add a binary to run all tests in a travis ci test suite +s...
- Loading branch information
Showing
1 changed file
with
61 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|