Sha256: 81260d9a0f16d74cad84b443d661173e7d1d773b3d83b2798539a218ab7a8da5

Contents?: true

Size: 1.33 KB

Versions: 7

Compression:

Stored size: 1.33 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 RAILS_ENV=test
check_errs $? "Tests failed." 
benchmark

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
blacklight-4.1.0 test_support/bin/run-tests.sh
blacklight-4.0.1 test_support/bin/run-tests.sh
blacklight-4.0.0 test_support/bin/run-tests.sh
blacklight-4.0.0.rc2 test_support/bin/run-tests.sh
blacklight-4.0.0.rc1 test_support/bin/run-tests.sh
blacklight-4.0.0.pre7 test_support/bin/run-tests.sh
blacklight-4.0.0.pre6 test_support/bin/run-tests.sh