Try with TZInfo and Timezone gems

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66079 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2018-11-28 14:08:34 +00:00
parent ab73b30539
commit 2d0833e101
3 changed files with 45 additions and 1 deletions

View File

@ -76,6 +76,8 @@ env:
# JOBS and SETARCH are overridden when necessary; see below.
- JOBS=-j$((1+${NPROC}))
- SETARCH=
- RUBY_PREFIX=/tmp/ruby-prefix
- GEMS_FOR_TEST='timezone tzinfo'
.org.ruby-lang.ci.matrix-definitions:
@ -343,7 +345,7 @@ before_script:
[ ! -f config.cache ] ||
[ "$CC" = "`sed -n s/^ac_cv_prog_CC=//p config.cache`" ] ||
(set -x; exec rm config.cache)
- $SETARCH ../configure -C --disable-install-doc --prefix=/tmp/ruby-prefix $CONFIG_FLAG
- $SETARCH ../configure -C --disable-install-doc --prefix=$RUBY_PREFIX $CONFIG_FLAG
- cp -pr config.cache config.status .ext/include ../config_1st
- $SETARCH make reconfig
- cp -pr config.cache config.status .ext/include ../config_2nd
@ -354,6 +356,7 @@ before_script:
- chmod u-w ..
- $SETARCH make -s $JOBS && make install
- ccache --show-stats
- [ -z "${GEMS_FOR_TEST}" ] || $RUBY_PREFIX/bin/gem install --no-document $GEMS_FOR_TEST
script:
- $SETARCH make -s test TESTOPTS="${TESTOPTS=$JOBS -q --tty=no}"

View File

@ -16,6 +16,7 @@ environment:
- build: vs
vs: 140
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
GEMS_FOR_TEST: "timezone tzinfo"
notifications:
- provider: Webhook
url:
@ -89,6 +90,7 @@ for:
- nmake -l
- nmake install-nodoc
- \usr\bin\ruby -v -e "p :locale => Encoding.find('locale'), :filesystem => Encoding.find('filesystem')"
- if not "%GEMS_FOR_TEST%" == "" \usr\bin\gem install --no-document %GEMS_FOR_TEST%
test_script:
- set /a JOBS=%NUMBER_OF_PROCESSORS%
- nmake -l "TESTOPTS=-v -q" btest
@ -134,6 +136,7 @@ for:
- mingw32-make -j%JOBS% up
- mingw32-make -j%JOBS%
- mingw32-make DESTDIR=../install install-nodoc
- if not "%GEMS_FOR_TEST%" == "" ..\install\bin\gem install --no-document %GEMS_FOR_TEST%
test_script:
- mingw32-make test
- mingw32-make test-all TESTOPTS="--retry --job-status=normal --show-skip --subprocess-timeout-scale=1.5 --excludes=../ruby/test/excludes/_appveyor -j %JOBS% --exclude win32ole --exclude test_open-uri"

View File

@ -603,3 +603,41 @@ class TestTimeTZ::DummyTZ < Test::Unit::TestCase
TestTimeTZ::TZ.new(tzname, abbr, utc_offset)
end
end
begin
require "tzinfo"
rescue LoadError
else
class TestTimeTZ::GemTZInfo < Test::Unit::TestCase
include TestTimeTZ::WithTZ
class TIME_CLASS < ::Time
def self.find_timezone(tzname)
TZInfo::Timezone.get(tzname)
end
end
def tz
@tz ||= TZInfo::Timezone.get(tzname)
end
end
end
begin
require "timezone"
rescue LoadError
else
class TestTimeTZ::GemTimezone < Test::Unit::TestCase
include TestTimeTZ::WithTZ
class TIME_CLASS < ::Time
def self.find_timezone(name)
Timezone[name]
end
end
def tz
@tz ||= Timezone[tzname]
end
end
end