Skip to content

Instantly share code, notes, and snippets.

@vvs
Created January 11, 2010 22:11
Show Gist options
  • Save vvs/274659 to your computer and use it in GitHub Desktop.
Save vvs/274659 to your computer and use it in GitHub Desktop.
# default RubySpec/CI settings for JRuby.
# detect windows platform:
require 'rbconfig'
require 'java'
require 'jruby'
IKVM = java.lang.System.get_property('java.vm.name') =~ /IKVM\.NET/
WINDOWS = Config::CONFIG['host_os'] =~ /mswin/
SPEC_DIR = File.join(File.dirname(__FILE__), 'ruby') unless defined?(SPEC_DIR)
TAGS_DIR = File.join(File.dirname(__FILE__), 'tags') unless defined?(TAGS_DIR)
class MSpecCI
# Language features specs
set :language, [ SPEC_DIR + '/language' ]
# Core library specs
set :core, [
SPEC_DIR + '/core',
# 1.9
'^' + SPEC_DIR + '/core/basicobject'
]
# Filter out ObjectSpace specs if ObjectSpace is disabled
unless JRuby.objectspace
get(:core) << '^' + SPEC_DIR + '/core/objectspace/_id2ref'
get(:core) << '^' + SPEC_DIR + '/core/objectspace/each_object'
end
if IKVM
# ftype_spec freezes for some reason under IKVM
set(:core, get(:core) + ['^' + SPEC_DIR + '/core/file'])
# Process.kill spec hangs
set(:core, get(:core) + ['^' + SPEC_DIR + '/core/process'])
end
# An ordered list of the directories containing specs to run
# as the CI process.
set :library, [
SPEC_DIR + '/library',
# excluded for some reason, see JRUBY-4020
'^' + SPEC_DIR + '/library/drb',
'^' + SPEC_DIR + '/library/etc',
'^' + SPEC_DIR + '/library/net',
'^' + SPEC_DIR + '/library/openssl',
'^' + SPEC_DIR + '/library/ping',
'^' + SPEC_DIR + '/library/readline',
# unstable
'^' + SPEC_DIR + '/library/socket',
'^' + SPEC_DIR + '/library/syslog',
# 1.9 feature
'^' + SPEC_DIR + '/library/cmath',
'^' + SPEC_DIR + '/library/continuation',
'^' + SPEC_DIR + '/library/coverage',
'^' + SPEC_DIR + '/library/fiber',
'^' + SPEC_DIR + '/library/json',
'^' + SPEC_DIR + '/library/minitest',
'^' + SPEC_DIR + '/library/prime',
'^' + SPEC_DIR + '/library/ripper',
'^' + SPEC_DIR + '/library/rake',
'^' + SPEC_DIR + '/library/rubygems',
]
# Command Line specs
set :command_line, [ SPEC_DIR + '/command_line' ]
if WINDOWS
# core
get(:core) << '^' + SPEC_DIR + '/core/argf' # hangs
get(:core) << '^' + SPEC_DIR + '/core/env' # many failures
get(:core) << '^' + SPEC_DIR + '/core/file' # many failures
get(:core) << '^' + SPEC_DIR + '/core/kernel' # many failures
get(:core) << '^' + SPEC_DIR + '/core/process' # many failures
# exclude specs tagged with 'windows' keyword
# set :xtags, ['windows']
set :ci_xtags, ['windows']
end
set :ci_files, get(:language) + get(:core) + get(:library) + get(:command_line)
# The default implementation to run the specs.
set :target, File.dirname(__FILE__) + '/../bin/' + Config::CONFIG['ruby_install_name'] + Config::CONFIG['EXEEXT']
set :backtrace_filter, /mspec\//
set :tags_patterns, [
[%r(^.*/language/), TAGS_DIR + '/1.8/ruby/language/'],
[%r(^.*/core/), TAGS_DIR + '/1.8/ruby/core/'],
[%r(^.*/command_line/), TAGS_DIR + '/1.8/ruby/command_line/'],
[%r(^.*/library/), TAGS_DIR + '/1.8/ruby/library/'],
[/_spec.rb$/, '_tags.txt']
]
end
ruby -S mspec -t j ci core\filetest
jruby 1.5.0.dev (ruby 1.8.7 patchlevel 174) (2010-01-11 9cf69a6) (Java HotSpot(TM) Client VM 1.6.0_17) [x86-java]
D:/work/jruby-dev/jruby/spec/jruby.1.8.mspec:16: undefined method `set' for MSpecCI:Class (NoMethodError)
from D:/work/jruby-dev/jruby/spec/jruby.1.8.mspec:3:in `load'
from ./jruby.1.8.mspec:3
from ./jruby.1.8.mspec:72:in `load'
from D:/work/jruby-dev/mspec.git/lib/mspec/utils/script.rb:72:in `load'
from D:/work/jruby-dev/mspec.git/lib/mspec/utils/script.rb:71:in `each'
from D:/work/jruby-dev/mspec.git/lib/mspec/utils/script.rb:71:in `load'
from D:/work/jruby-dev/mspec.git/lib/mspec/utils/script.rb:96:in `load_default'
from D:/work/jruby-dev/mspec.git/lib/mspec/utils/script.rb:212:in `main'
from D:/work/jruby-dev/mspec.git/bin/mspec-run:8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment