mirror of
https://github.com/smarty-php/smarty.git
synced 2025-07-29 15:37:14 +02:00
Re-organize all testrunners to use the same script(s). (#812)
This commit is contained in:
6
.github/workflows/ci.yml
vendored
6
.github/workflows/ci.yml
vendored
@ -71,9 +71,5 @@ jobs:
|
||||
restore-keys: |
|
||||
${{ runner.os }}-php-${{ matrix.php-version }}-
|
||||
|
||||
- name: Install dependencies
|
||||
if: steps.composer-cache.outputs.cache-hit != 'true'
|
||||
run: composer install --prefer-dist --no-progress --no-suggest
|
||||
|
||||
- name: Run tests with phpunit
|
||||
run: ./phpunit.sh
|
||||
run: ./run-tests.sh
|
||||
|
@ -7,7 +7,7 @@ services:
|
||||
volumes:
|
||||
- .:/app
|
||||
working_dir: /app
|
||||
entrypoint: sh ./utilities/testrunners/run-test.sh
|
||||
entrypoint: sh ./run-tests.sh
|
||||
php71:
|
||||
extends:
|
||||
service: base
|
||||
|
44
run-tests-for-all-php-versions.sh
Executable file
44
run-tests-for-all-php-versions.sh
Executable file
@ -0,0 +1,44 @@
|
||||
#!/bin/bash
|
||||
Help()
|
||||
{
|
||||
# Display Help
|
||||
echo "Runs PHPUnit tests for all PHP versions supported by this version of Smarty."
|
||||
echo
|
||||
echo "Syntax: $0 [-e|h]"
|
||||
echo "options:"
|
||||
echo "e Exclude a group of unit tests, e.g. -e 'slow'"
|
||||
echo "h Print this Help."
|
||||
echo
|
||||
}
|
||||
|
||||
Exclude=""
|
||||
|
||||
# Get the options
|
||||
while getopts ":he:" option; do
|
||||
case $option in
|
||||
e) # Exclude
|
||||
echo $OPTARG
|
||||
Exclude=$OPTARG;;
|
||||
h) # display Help
|
||||
Help
|
||||
exit;;
|
||||
\?) # Invalid option
|
||||
echo "Error: Invalid option"
|
||||
exit;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ -z $Exclude ];
|
||||
then
|
||||
Entrypoint="./run-tests.sh"
|
||||
else
|
||||
Entrypoint="./run-tests.sh $Exclude"
|
||||
fi
|
||||
|
||||
# Runs tests for all supported PHP versions
|
||||
docker-compose run --entrypoint "$Entrypoint" php71 && \
|
||||
docker-compose run --entrypoint "$Entrypoint" php72 && \
|
||||
docker-compose run --entrypoint "$Entrypoint" php73 && \
|
||||
docker-compose run --entrypoint "$Entrypoint" php74 && \
|
||||
docker-compose run --entrypoint "$Entrypoint" php80 && \
|
||||
docker-compose run --entrypoint "$Entrypoint" php81
|
13
run-tests.sh
Executable file
13
run-tests.sh
Executable file
@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
composer update
|
||||
|
||||
php -r 'echo "\nPHP version " . phpversion() . ". ";';
|
||||
|
||||
if [ -z $1 ];
|
||||
then
|
||||
echo "Running all unit tests.\n"
|
||||
php ./vendor/phpunit/phpunit/phpunit
|
||||
else
|
||||
echo "Running all unit tests, except tests marked with @group $1.\n"
|
||||
php ./vendor/phpunit/phpunit/phpunit --exclude-group $1
|
||||
fi
|
@ -1,7 +0,0 @@
|
||||
# Runs tests for all supported PHP versions
|
||||
docker-compose run php71 && \
|
||||
docker-compose run php72 && \
|
||||
docker-compose run php73 && \
|
||||
docker-compose run php74 && \
|
||||
docker-compose run php80 && \
|
||||
docker-compose run php81
|
@ -1,2 +0,0 @@
|
||||
#!/bin/sh
|
||||
composer update && php ./vendor/phpunit/phpunit/phpunit
|
Reference in New Issue
Block a user