diff --git a/.travis.yml b/.travis.yml index 9229fd85..7a32fa54 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,9 +3,15 @@ php: - 5.3.3 - 5.4 - 5.5 + - 5.6 + - hhvm + +matrix: + allow_failures: + - php: hhvm script: VERBOSE=true ./tests/run-tests.sh -s tests/ before_script: # Install Nette Tester - - composer install --no-interaction --dev + - composer install --no-interaction --dev --prefer-source diff --git a/tests/dibi/DibiFluent.cloning.phpt b/tests/dibi/DibiFluent.cloning.phpt index 888d8274..39b346e4 100644 --- a/tests/dibi/DibiFluent.cloning.phpt +++ b/tests/dibi/DibiFluent.cloning.phpt @@ -6,6 +6,7 @@ * @author David Grudl */ +use Tester\Assert; require __DIR__ . '/bootstrap.php'; diff --git a/tests/dibi/DibiTranslator.DateTimeInterface.phpt b/tests/dibi/DibiTranslator.DateTimeInterface.phpt index b4d1610d..777ce62e 100644 --- a/tests/dibi/DibiTranslator.DateTimeInterface.phpt +++ b/tests/dibi/DibiTranslator.DateTimeInterface.phpt @@ -7,6 +7,7 @@ * @phpversion 5.5 */ +use Tester\Assert; require __DIR__ . '/bootstrap.php'; diff --git a/tests/dibi/bootstrap.php b/tests/dibi/bootstrap.php index 4720e20c..e38b1e18 100644 --- a/tests/dibi/bootstrap.php +++ b/tests/dibi/bootstrap.php @@ -11,4 +11,3 @@ require __DIR__ . '/../../dibi/dibi.php'; $config = require __DIR__ . '/config.php'; date_default_timezone_set('Europe/Prague'); -class_alias('Tester\Assert', 'Assert'); diff --git a/tests/RunTests.bat b/tests/run-tests.bat similarity index 61% rename from tests/RunTests.bat rename to tests/run-tests.bat index 98a5d8ac..e641387c 100644 --- a/tests/RunTests.bat +++ b/tests/run-tests.bat @@ -6,6 +6,6 @@ IF NOT EXIST "%~dp0..\vendor\nette\tester" ( EXIT /B 2 ) -php.exe -n "%~dp0..\vendor\nette\tester\Tester\tester.php" -p php-cgi.exe -c "%~dp0php-win.ini" -j 20 -log "%~dp0test.log" %* +php -n "%~dp0..\vendor\nette\tester\Tester\tester.php" -p php-cgi.exe -c "%~dp0php-win.ini" -j 20 -log "%~dp0test.log" %* rmdir "%~dp0/tmp" /S /Q diff --git a/tests/run-tests.sh b/tests/run-tests.sh index 80a8f3bb..098582a4 100755 --- a/tests/run-tests.sh +++ b/tests/run-tests.sh @@ -16,9 +16,10 @@ jobsNum=20 phpIni="$dir/php-unix.ini" # Command line arguments processing -for i in `seq 1 $#`; do +i=$# +while [ $i -gt 0 ]; do if [ "$1" = "-j" ]; then - shift + shift && i=$(($i - 1)) if [ -z "$1" ]; then echo "Missing argument for -j option." >&2 exit 2 @@ -26,7 +27,7 @@ for i in `seq 1 $#`; do jobsNum="$1" elif [ "$1" = "-c" ]; then - shift + shift && i=$(($i - 1)) if [ -z "$1" ]; then echo "Missing argument for -c option." >&2 exit 2 @@ -36,15 +37,15 @@ for i in `seq 1 $#`; do else set -- "$@" "$1" fi - shift + shift && i=$(($i - 1)) done # Run tests with script's arguments, doubled -c option intentionally -php -c "$phpIni" "$runnerScript" -j "$jobsNum" -c "$phpIni" "$@" +php -n -c "$phpIni" "$runnerScript" -j "$jobsNum" -c "$phpIni" "$@" error=$? # Print *.actual content if tests failed if [ "${VERBOSE-false}" != "false" -a $error -ne 0 ]; then - for i in $(find . -name \*.actual); do echo "--- $i"; cat $i; echo; echo; done + for i in $(find "$dir" -name \*.actual); do echo "--- $i"; cat $i; echo; echo; done exit $error fi