Skip to content

Commit 6d3fef9

Browse files
authored
Merge pull request #276 from wp-cli/try/behat-xdebug-flag
2 parents 5b42c27 + d37afa8 commit 6d3fef9

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

bin/run-behat-tests

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,10 @@ export WP_CLI_TESTS_ROOT
4444
# Generate the tags to apply environment-specific filters.
4545
BEHAT_TAGS=$(php "$WP_CLI_TESTS_ROOT"/utils/behat-tags.php)
4646

47+
BEHAT_EXTRA_ARGS=()
48+
if [[ "${WP_CLI_TEST_COVERAGE}" == "true" ]] && vendor/bin/behat --help 2>/dev/null | grep -q 'xdebug'; then
49+
BEHAT_EXTRA_ARGS+=('--xdebug')
50+
fi
51+
4752
# Run the functional tests.
48-
vendor/bin/behat --format progress "$BEHAT_TAGS" --strict "$@"
53+
vendor/bin/behat --format progress "$BEHAT_TAGS" --strict "${BEHAT_EXTRA_ARGS[@]}" "$@"

0 commit comments

Comments
 (0)