mirror of
https://github.com/jekyll/jekyll.git
synced 2026-04-06 03:01:43 -04:00
Add support for JRuby, it was easier than assumed.
This commit is contained in:
@@ -1,12 +1,15 @@
|
||||
#! /bin/bash
|
||||
#! /bin/bash -e
|
||||
|
||||
script/branding
|
||||
|
||||
set -e
|
||||
|
||||
if test -z "$TEST_SUITE"; then
|
||||
script/test
|
||||
if [[ -z "$TEST_SUITE" ]]
|
||||
then
|
||||
script/test ci
|
||||
script/cucumber
|
||||
else
|
||||
elif [[ -x "script/$TEST_SUITE" ]]
|
||||
then
|
||||
script/$TEST_SUITE
|
||||
else
|
||||
echo "Unknown test suite."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
time bundle exec cucumber \
|
||||
-f Features::Support::Overview \
|
||||
"$@"
|
||||
if ruby --version | grep -q "jruby"
|
||||
then
|
||||
echo "Move along, we are not testing features on JRuby right now."
|
||||
exit 0
|
||||
else
|
||||
time ruby -S bundle exec cucumber \
|
||||
-f Features::Support::Overview \
|
||||
"$@"
|
||||
fi
|
||||
|
||||
52
script/test
52
script/test
@@ -1,15 +1,55 @@
|
||||
#! /bin/bash
|
||||
set -e
|
||||
#! /bin/bash -e
|
||||
|
||||
# Usage:
|
||||
# script/test
|
||||
# script/test <test_file>
|
||||
# script/test [ruby|jruby]
|
||||
# script/test
|
||||
|
||||
if [ -d test/dest ]
|
||||
then rm -r test/dest
|
||||
fi
|
||||
|
||||
if [[ $# -lt 1 ]]
|
||||
then time bundle exec rake TESTOPTS='--profile' test
|
||||
else time bundle exec ruby -Itest "$@" --profile
|
||||
# -----------------------------------------------------------------------------
|
||||
# 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 bundle exec ruby -Itest \
|
||||
"$@" --profile
|
||||
fi
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user