File: test

package info (click to toggle)
ruby-jekyll-data 1.1.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 420 kB
  • sloc: ruby: 909; sh: 95; makefile: 10
file content (56 lines) | stat: -rwxr-xr-x 1,026 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/usr/bin/env bash
set -e

# Usage:
#   script/test <test_file>
#   script/test [ruby|jruby]
#   script/test

if [ -d test/dest ]
  then rm -r test/dest
fi

# -----------------------------------------------------------------------------
# If you send us a ruby then we use that, if you do not then we test with
# whatever we can detect, this way you can run both suites when you test out
# your source, we expect full coverage now, not just MRI.
# -----------------------------------------------------------------------------

if [[ "$1" == "ci" ]]
then
  rubies=(
    ruby
  )

  shift
elif [[ "$1" == "ruby" ]] || [[ "$1" == "jruby" ]]
then
  rubies=(
    $1
  )

  shift
else
  rubies=($(script/rubies))
fi


for ruby in $rubies; do
  if [[ "$ruby" == "jruby" ]]
  then
    testopts=""
  else
    testopts="--profile"
  fi

  if [[ $# -lt 1 ]]
  then
    set -x
    time $ruby -S bundle exec \
      rake TESTOPTS=$testopts test
  else
    set -x
    time $ruby -S bundle exec ruby -I test \
      "$@" $testops
  fi
done