Last change
on this file since 580 was
541,
checked in by anonymous, 9 years ago
|
v2.2.0-3: Fixed auth password hashing verification issues. Updated hyperlinkTxt() with option. Updated tests.
|
File size:
1.0 KB
|
Rev | Line | |
---|
[468] | 1 | #!/bin/bash |
---|
[15] | 2 | |
---|
[468] | 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="..." |
---|
| 9 | |
---|
[15] | 10 | # Be in the directory with all the tests. |
---|
| 11 | cd `dirname $0`; |
---|
| 12 | |
---|
[468] | 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 | |
---|
[399] | 24 | # Create database. |
---|
| 25 | mysql -e 'CREATE DATABASE IF NOT EXISTS `test`'; |
---|
| 26 | |
---|
[468] | 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 ' |
---|
[541] | 33 | phpunit --stderr || echo "Something went wrong (if there is no output above, check the php_error_log)"; |
---|
Note: See
TracBrowser
for help on using the repository browser.