Changeset 468 for trunk/tests/run_tests.sh
- Timestamp:
- Feb 20, 2014 3:03:59 AM (10 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property
svn:mergeinfo
set to
/branches/eli_branch merged eligible
-
Property
svn:mergeinfo
set to
-
trunk/tests/run_tests.sh
r399 r468 1 #!/bin/sh 1 #!/bin/bash 2 3 # This script sets-up the test environment and runs all tests. 4 # You'll want to define your local mysql credentials for a test 5 # database as environment variables, e.g., in ~/.bash_profile: 6 # export DB_NAME="test" 7 # export DB_USER="test" 8 # export DB_PASS="..." 2 9 3 10 # Be in the directory with all the tests. 4 11 cd `dirname $0`; 5 12 13 # Get required ENV variables. 14 if [[ -z "$DB_USER$DB_PASS$DB_NAME" ]]; then 15 echo "MySQL test DB credential environment variables are missing.\nSet these in ~/.bash_profile to avoid seeing these prompts each time."; 16 fi 17 for E in DB_USER DB_PASS DB_NAME; do 18 while [[ -z ${!E} ]]; do 19 read -p "$E: " $E; 20 done 21 export $E; 22 done 23 6 24 # Create database. 7 25 mysql -e 'CREATE DATABASE IF NOT EXISTS `test`'; 8 26 9 # Run tests sequentially. 10 for foo in *Test.php; 11 do 12 php $foo; 13 done; 27 # Go! 28 echo "Running the tests!"; 29 echo "You'll want to 'tail -f /tmp/codebase_test_log' and watch for errors."; 30 31 # Config options go in phpunit.xml 32 # phpunit --tap | grep -v '^ok ' 33 phpunit --stderr
Note: See TracChangeset
for help on using the changeset viewer.