diff --git a/configuration.sh b/configuration.sh index d4e2820..fb1c52d 100644 --- a/configuration.sh +++ b/configuration.sh @@ -45,6 +45,9 @@ DRUPAL_TESTING_COMPOSER_NAME=${DRUPAL_TESTING_COMPOSER_NAME:-$(jq -r .name "${DR # vendor/myproject the project name will be myproject. DRUPAL_TESTING_PROJECT_NAME=${DRUPAL_TESTING_PROJECT_NAME-$(jq -r --arg FALLBACK "$(echo "${DRUPAL_TESTING_COMPOSER_NAME}" | cut -d '/' -f 2)" '.extra."installer-name" // $FALLBACK' "${DRUPAL_TESTING_PROJECT_BASEDIR}/composer.json")} +# The phpunit configuration file to use. Defaults to docroot/core/phpunit.xml.dist +DRUPAL_TESTING_TEST_CONFIGURATION=${DRUPAL_TESTING_TEST_CONFIGURATION:-""} + # Path for phpunit to search for test files. Default is the current project folder. DRUPAL_TESTING_TEST_PATH=${DRUPAL_TESTING_TEST_PATH:-""} diff --git a/lib/stages/run_tests.sh b/lib/stages/run_tests.sh index 95da93f..7b9615b 100644 --- a/lib/stages/run_tests.sh +++ b/lib/stages/run_tests.sh @@ -9,7 +9,11 @@ _stage_run_tests() { test_location=$(get_project_location) local test_selection="" - local phpunit="composer exec -- phpunit --debug" + local phpunit="composer exec -- phpunit" + + if [ "${DRUPAL_TESTING_VERBOSE}" = true ]; then + phpunit="${phpunit} --debug" + fi if [ "${DRUPAL_TESTING_PARALLEL_TESTING}" = true ]; then phpunit="composer exec -- paratest -p "${DRUPAL_TESTING_PARALLEL_TESTING_PROCESSES} @@ -50,7 +54,13 @@ _stage_run_tests() { test_selection="${test_selection} --filter ${DRUPAL_TESTING_TEST_FILTER}" fi - local runtest="${phpunit} --configuration ${docroot}/core ${test_selection} ${test_location}" + if [[ ${DRUPAL_TESTING_TEST_CONFIGURATION} ]]; then + test_selection="${test_selection} --configuration ${DRUPAL_TESTING_TEST_CONFIGURATION}" + else + test_selection="${test_selection} --configuration ${docroot}/core" + fi + + local runtest="${phpunit} ${test_selection} ${test_location}" cd "${DRUPAL_TESTING_DRUPAL_INSTALLATION_DIRECTORY}" || exit eval "COMPOSER_PROCESS_TIMEOUT=0 ${runtest}" || exit 1