run_tests.sh revision c3fdcc2da9c4c56f007199affb5cfa2ae6860ee8
1#!/bin/bash
2#
3# Copyright 2011 Google Inc. All Rights Reserved.
4# Author: raymes@google.com (Raymes Khoury)
5
6# Make sure the base toolchain-utils directory is in our PYTHONPATH before
7# trying to run this script.
8export PYTHONPATH+=":.."
9
10num_tests=0
11num_failed=0
12
13for test in $(find -name \*test.py); do
14  echo RUNNING: ${test}
15  ((num_tests++))
16  if ! ./${test} ; then
17    echo
18    echo "*** Test Failed! (${test}) ***"
19    echo
20    ((num_failed++))
21  fi
22done
23
24echo
25
26if [ ${num_failed} -eq 0 ] ; then
27  echo "ALL TESTS PASSED (${num_tests} ran)"
28  exit 0
29fi
30
31echo "${num_failed} TESTS FAILED (out of ${num_tests})"
32exit 1
33