Created
February 20, 2013 19:30
-
-
Save aaronzirbes/4998543 to your computer and use it in GitHub Desktop.
Find groovy classes that don't have Spock tests written for them yet.
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 | |
groovy_src=src/main/groovy | |
spec_src=src/test/groovy | |
groovy_classes='_groovy_classes.txt' | |
specs='_spock_specs.txt' | |
find ${groovy_src} -name *.groovy \ | |
| sed -e 's#.*/##' -e 's/\.groovy$//' \ | |
| sort -u \ | |
> ${groovy_classes} | |
find ${spec_src} -name *Spec.groovy \ | |
| sed -e 's#.*/##' -e 's/Spec\.groovy$//' \ | |
| sort -u \ | |
> ${specs} | |
missing_classes=`join -v 1 ${groovy_classes} ${specs}` | |
echo "Classes missing specs" | |
echo "=====================" | |
for class in ${missing_classes}; do | |
package=`find ${groovy_src} -name ${class}.groovy |xargs grep -E '^package ' |sed -e 's/^package //'` | |
echo "${package}.${class}" | |
done | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment