Sha256: e6a78a9b841a8dd9715bd8d2acf7f908fb1fff198c9a4f0629959a6e57693d45

Contents?: true

Size: 1.28 KB

Versions: 12

Compression:

Stored size: 1.28 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

# 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." 

cd tmp/test_app
bundle exec rake blacklight:hudson
check_errs $? "Tests failed." 
benchmark

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
blacklight-3.5.0 test_support/bin/run-tests.sh
blacklight-3.4.2 test_support/bin/run-tests.sh
blacklight-3.4.1 test_support/bin/run-tests.sh
blacklight-3.4.0 test_support/bin/run-tests.sh
blacklight-3.3.2 test_support/bin/run-tests.sh
blacklight-3.3.1 test_support/bin/run-tests.sh
blacklight-3.3.0 test_support/bin/run-tests.sh
blacklight-3.2.2 test_support/bin/run-tests.sh
blacklight-3.2.1 test_support/bin/run-tests.sh
blacklight-3.2.0 test_support/bin/run-tests.sh
blacklight-3.2.0pre2 test_support/bin/run-tests.sh
blacklight-3.2.0pre1 test_support/bin/run-tests.sh