Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 9efcc65f41
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 37 lines (31 sloc) 0.6 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
# See maven/post_maven_tests.sh for an example use

SCRIPT_NAME=$0
TEST_NAME=${1:-ALL}

function get_tests() {
  if [ $TEST_NAME == "ALL" ]; then
part1=function
part2=TEST_
    grep "$part1 $part2" $SCRIPT_NAME | sed 's/.*\(TEST_[A-Za-z0-9_]*\).*/\1/'
  else
echo "TEST_${TEST_NAME}"
  fi
}

function run_tests() {
  local exit_code=0

  for t in $(get_tests); do
echo "RUNNING: $t"
    if "$t"; then
echo "PASSED: $t"
    else
echo "FAILED: $t"
      return 1
    fi
done
}

if run_tests; then
echo "ALL TESTS PASSED"
  exit 0
else
echo "A TEST FAILED"
  exit 1
fi
Something went wrong with that request. Please try again.