Sha256: b86f7c628eb8e09421dd06aee903e398f0efc7aa997e14c968fd57a457d21e10
Contents?: true
Size: 1.31 KB
Versions: 8
Compression:
Stored size: 1.31 KB
Contents
#!/bin/bash # test.sh # Create a default rails appliaction, install blacklight, and run all the tests. before="$(date +%s)" benchmark() { after="$(date +%s)" elapsed_seconds="$(expr $after - $before)" echo "Total Time: ${elapsed_seconds} sec" # as a bonus, make our script exit with the right error code. } check_errs() { # Function. Parameter 1 is the return code # Para. 2 is text to display on failure. if [ "${1}" -ne "0" ]; then echo "ERROR # ${1} : ${2}" benchmark exit 1 fi } # Make sure we are in the blacklight directory if [ ! -f "blacklight.gemspec" ] then echo "You must execute test.sh from the root of your blacklight checkout." exit 1 fi if [[ $# -gt 0 ]] then # Make certain rvn will work correctly. # Load RVM into a shell session *as a function* if [[ -s "$HOME/.rvm/scripts/rvm" ]] ; then # First try to load from a user install source "$HOME/.rvm/scripts/rvm" elif [[ -s "/usr/local/rvm/scripts/rvm" ]] ; then # Then try to load from a root install source "/usr/local/rvm/scripts/rvm" else printf "ERROR: An RVM installation was not found.\n" exit 1 fi rvm use "$@" --create check_errs $? "rvm failed. please run 'rvm install $@', and then re-run these tests." fi cd tmp/test_app bundle exec rake blacklight:hudson check_errs $? "Tests failed." benchmark
Version data entries
8 entries across 8 versions & 1 rubygems