Created
September 12, 2012 11:16
-
-
Save topolik/3706003 to your computer and use it in GitHub Desktop.
Bash script for running Liferay tests
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 | |
cat > portal-impl/src/portal-test-ext.properties <<EOF | |
jdbc.default.driverClassName=com.mysql.jdbc.Driver | |
jdbc.default.url=jdbc:mysql://localhost/lportal_test?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false | |
jdbc.default.username=root | |
jdbc.default.password= | |
index.on.startup=true | |
EOF | |
mysqlcheck -u root lportal_test > /dev/null 2>&1 | |
if [ $? == 0 ] | |
then | |
mysqldump -u root lportal_test | grep DROP | mysql -u root lportal_test | |
else | |
echo "CREATE DATABASE lportal_test DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;" | mysql -u root | |
fi | |
rm -rf liferay | |
ant test-unit | |
ant test-integration | |
echo | |
echo '************************************' | |
echo '* FOUND ERRORS *' | |
echo '************************************' | |
echo | |
find -name TEST-*.xml -print0 | xargs -0 grep '<error' | |
echo | |
echo '*********************************************' | |
echo '* FOUND TEST FAILURES *' | |
echo '*********************************************' | |
echo | |
find -name TEST-*.xml -print0 | xargs -0 grep '<failure' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment