Only run tests with --profile when using MRI.

This commit is contained in:
Parker Moore 2016-06-23 19:08:53 -07:00
parent aeca7a195e
commit 6f5ad2530e
No known key found for this signature in database
GPG Key ID: 193CDEBA72063C58
2 changed files with 25 additions and 11 deletions

14
script/rubies Executable file
View File

@ -0,0 +1,14 @@
#!/bin/bash
# -----------------------------------------------------------------------------
# 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.
# -----------------------------------------------------------------------------
rubies=()
for r in jruby ruby; do
if which "$r" > /dev/null 2>&1
then
echo $r
fi
done

View File

@ -31,26 +31,26 @@ then
shift
else
rubies=()
for r in jruby ruby; do
if which "$r"
then
rubies+=(
$r
)
fi
done
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='--profile' test
rake TESTOPTS=$testopts test
else
set -x
time $ruby -S bundle exec ruby -Itest \
"$@" --profile
"$@" $testops
fi
done