Last active
January 2, 2016 07:09
-
-
Save bcaudan/8268052 to your computer and use it in GitHub Desktop.
Check test files for "ddescribe", "iit" or "pause()".
Usage: check-js-test src/test/javascript/unit src/test/javascript/e2e
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function hasAny() { | |
sep="\|" | |
regex="$( printf "${sep}%s" "$@" )" | |
regex="${regex:${#sep}}" | |
grep -nri --color=always "$regex" * | |
} | |
SEARCH="hasAny 'ddescribe' 'iit' 'pause()'" | |
EXIT_STATUS=0 | |
for TEST_PATH in "$@" | |
do | |
cd "$TEST_PATH" | |
echo "$SEARCH in '$TEST_PATH'" | |
eval "$SEARCH" | |
HAS_RESULT=!$? | |
(( EXIT_STATUS=$EXIT_STATUS || $HAS_RESULT )) | |
cd - | |
done | |
exit $EXIT_STATUS |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment