From 6f5ad2530e3e1dd028335ca10429516d10c52c26 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Thu, 23 Jun 2016 19:08:53 -0700 Subject: [PATCH] Only run tests with --profile when using MRI. --- script/rubies | 14 ++++++++++++++ script/test | 22 +++++++++++----------- 2 files changed, 25 insertions(+), 11 deletions(-) create mode 100755 script/rubies diff --git a/script/rubies b/script/rubies new file mode 100755 index 00000000..fb00ac61 --- /dev/null +++ b/script/rubies @@ -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 diff --git a/script/test b/script/test index 5aab2f06..133b9807 100755 --- a/script/test +++ b/script/test @@ -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