File: test

package info (click to toggle)
jekyll 3.1.6%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 3,820 kB
  • ctags: 997
  • sloc: ruby: 10,045; sh: 145; xml: 59; makefile: 28
file content (56 lines) | stat: -rwxr-xr-x 1,023 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=()
  for r in jruby ruby; do
    if which "$r"
    then
      rubies+=(
        $r
      )
    fi
  done
fi

for ruby in $rubies; do
  if [[ $# -lt 1 ]]
  then
    set -x
    time $ruby -S bundle exec \
      rake TESTOPTS='--profile' test
   else
    set -x
    time $ruby -S bundle exec ruby -Itest \
      "$@" --profile
  fi
done