mirror of
https://github.com/dg/dibi.git
synced 2025-08-04 13:17:58 +02:00
fixed test support files
This commit is contained in:
@@ -3,9 +3,15 @@ php:
|
|||||||
- 5.3.3
|
- 5.3.3
|
||||||
- 5.4
|
- 5.4
|
||||||
- 5.5
|
- 5.5
|
||||||
|
- 5.6
|
||||||
|
- hhvm
|
||||||
|
|
||||||
|
matrix:
|
||||||
|
allow_failures:
|
||||||
|
- php: hhvm
|
||||||
|
|
||||||
script: VERBOSE=true ./tests/run-tests.sh -s tests/
|
script: VERBOSE=true ./tests/run-tests.sh -s tests/
|
||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
# Install Nette Tester
|
# Install Nette Tester
|
||||||
- composer install --no-interaction --dev
|
- composer install --no-interaction --dev --prefer-source
|
||||||
|
@@ -6,6 +6,7 @@
|
|||||||
* @author David Grudl
|
* @author David Grudl
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use Tester\Assert;
|
||||||
|
|
||||||
require __DIR__ . '/bootstrap.php';
|
require __DIR__ . '/bootstrap.php';
|
||||||
|
|
||||||
|
@@ -7,6 +7,7 @@
|
|||||||
* @phpversion 5.5
|
* @phpversion 5.5
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use Tester\Assert;
|
||||||
|
|
||||||
require __DIR__ . '/bootstrap.php';
|
require __DIR__ . '/bootstrap.php';
|
||||||
|
|
||||||
|
@@ -11,4 +11,3 @@ require __DIR__ . '/../../dibi/dibi.php';
|
|||||||
$config = require __DIR__ . '/config.php';
|
$config = require __DIR__ . '/config.php';
|
||||||
|
|
||||||
date_default_timezone_set('Europe/Prague');
|
date_default_timezone_set('Europe/Prague');
|
||||||
class_alias('Tester\Assert', 'Assert');
|
|
||||||
|
@@ -6,6 +6,6 @@ IF NOT EXIST "%~dp0..\vendor\nette\tester" (
|
|||||||
EXIT /B 2
|
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
|
rmdir "%~dp0/tmp" /S /Q
|
@@ -16,9 +16,10 @@ jobsNum=20
|
|||||||
phpIni="$dir/php-unix.ini"
|
phpIni="$dir/php-unix.ini"
|
||||||
|
|
||||||
# Command line arguments processing
|
# Command line arguments processing
|
||||||
for i in `seq 1 $#`; do
|
i=$#
|
||||||
|
while [ $i -gt 0 ]; do
|
||||||
if [ "$1" = "-j" ]; then
|
if [ "$1" = "-j" ]; then
|
||||||
shift
|
shift && i=$(($i - 1))
|
||||||
if [ -z "$1" ]; then
|
if [ -z "$1" ]; then
|
||||||
echo "Missing argument for -j option." >&2
|
echo "Missing argument for -j option." >&2
|
||||||
exit 2
|
exit 2
|
||||||
@@ -26,7 +27,7 @@ for i in `seq 1 $#`; do
|
|||||||
jobsNum="$1"
|
jobsNum="$1"
|
||||||
|
|
||||||
elif [ "$1" = "-c" ]; then
|
elif [ "$1" = "-c" ]; then
|
||||||
shift
|
shift && i=$(($i - 1))
|
||||||
if [ -z "$1" ]; then
|
if [ -z "$1" ]; then
|
||||||
echo "Missing argument for -c option." >&2
|
echo "Missing argument for -c option." >&2
|
||||||
exit 2
|
exit 2
|
||||||
@@ -36,15 +37,15 @@ for i in `seq 1 $#`; do
|
|||||||
else
|
else
|
||||||
set -- "$@" "$1"
|
set -- "$@" "$1"
|
||||||
fi
|
fi
|
||||||
shift
|
shift && i=$(($i - 1))
|
||||||
done
|
done
|
||||||
|
|
||||||
# Run tests with script's arguments, doubled -c option intentionally
|
# 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=$?
|
error=$?
|
||||||
|
|
||||||
# Print *.actual content if tests failed
|
# Print *.actual content if tests failed
|
||||||
if [ "${VERBOSE-false}" != "false" -a $error -ne 0 ]; then
|
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
|
exit $error
|
||||||
fi
|
fi
|
||||||
|
Reference in New Issue
Block a user