Ignore:
Timestamp:
Apr 27, 2017 2:57:13 PM (7 years ago)
Author:
anonymous
Message:

Update tests to function with phpunit 5.7 (not tested)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/run_tests.sh

    r541 r599  
    88#  export DB_PASS="..."
    99
     10function err {
     11    MSG="$1";
     12    IFS='';
     13    echo -e $MSG 1>&2
     14    exit 1;
     15}
     16
    1017# Be in the directory with all the tests.
    1118cd `dirname $0`;
     
    1522    echo "MySQL test DB credential environment variables are missing.\nSet these in ~/.bash_profile to avoid seeing these prompts each time.";
    1623fi
    17 for E in DB_USER DB_PASS DB_NAME; do
     24for E in DB_SERVER DB_NAME DB_USER DB_PASS; do
    1825    while [[ -z ${!E} ]]; do
    1926        read -p "$E: " $E;
     
    2330
    2431# Create database.
    25 mysql -e 'CREATE DATABASE IF NOT EXISTS `test`';
     32mysql -e "CREATE DATABASE IF NOT EXISTS \`${DB_NAME}\`" || err "Failed to create database '${DB_NAME}";
    2633
    2734# Go!
     
    3138# Config options go in phpunit.xml
    3239# phpunit --tap | grep -v '^ok '
    33 phpunit --stderr || echo "Something went wrong (if there is no output above, check the php_error_log)";
     40phpunit --stderr --colors --debug || err "\nSomething went wrong (code $?). If there is no output above, check the php_error_log";
     41
Note: See TracChangeset for help on using the changeset viewer.