Skip to content

Commit

Permalink
tests: improve usability of run-integration
Browse files Browse the repository at this point in the history
  • Loading branch information
JanTvrdik committed Sep 25, 2018
1 parent 47d870a commit adb6372
Showing 1 changed file with 21 additions and 10 deletions.
31 changes: 21 additions & 10 deletions tests/run-integration.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#!/usr/bin/env bash
set -o errexit -o pipefail -o nounset
shopt -s globstar
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_DIR="$(dirname "$DIR")"
PHP_VERSION=$(php -r "echo PHP_VERSION_ID;")
PHP_VERSION="$(php --run "echo PHP_VERSION_ID;")"


run()
Expand Down Expand Up @@ -41,7 +42,7 @@ run()
create_dbals_ini()
{
DBAL="$1"
INI_PATH="$DIR/dbals.ini"
INI_PATH="$PROJECT_DIR/tests/dbals.ini"

rm --force "$INI_PATH"
if [[ ! -z "$DBAL" ]]; then
Expand Down Expand Up @@ -90,14 +91,24 @@ tester_run_integration_group()
}


if [[ "$#" -gt 0 ]]; then
run "$1"
exit $?
fi
if [[ "$#" -eq 0 ]]; then
for FILENAME in "$PROJECT_DIR/tests/matrix"/**/*.sh; do
run "$FILENAME"
done

else
for ARG in "$@"; do
if [[ -f "$ARG" ]]; then
run "$ARG"

for INTEGRATION_GROUP in "$PROJECT_DIR/tests/cases/integration"/*; do
for FILENAME in "$PROJECT_DIR/tests/matrix/$(basename "$INTEGRATION_GROUP")"/*.sh; do
run "$FILENAME"
elif [[ -d "$ARG" ]]; then
for FILENAME in "$ARG"/**/*.sh; do
run "$FILENAME"
done

else
echo "Invalid argument, $ARG is neither file nor directory"
exit 1
fi
done
done
fi

0 comments on commit adb6372

Please sign in to comment.