Skip to content
This repository
tag: 1.6.7.1
Fetching contributors…

Cannot retrieve contributors at this time

file 113 lines (91 sloc) 3.676 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113
# Default RubySpec/CI settings for JRuby in 1.9 mode.

# detect windows platform:
require 'rbconfig'
require 'java'
require 'jruby/util'

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 MSpecScript
  # Language features specs
  set :language, [
    SPEC_DIR + '/language',
  ]

  # Core library specs
  set :core, [
    SPEC_DIR + '/core',

    '^' + SPEC_DIR + '/core/continuation',
    '^' + SPEC_DIR + '/core/encoding/converter'
  ]

  # 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',

    # obsolete libraries
    '^' + SPEC_DIR + '/library/enumerator',
    '^' + SPEC_DIR + '/library/ftools',
    '^' + SPEC_DIR + '/library/generator',
    '^' + SPEC_DIR + '/library/parsedate',
    '^' + SPEC_DIR + '/library/ping',
  ]

  # Command Line specs
  set :command_line, [ SPEC_DIR + '/command_line' ]

  # Enable features
  MSpec.enable_feature :continuation
  MSpec.enable_feature :fiber
  MSpec.enable_feature :fiber_library
  MSpec.enable_feature :encoding
  MSpec.enable_feature :encoding_transition
  MSpec.enable_feature :readline

  if WINDOWS
    # Some specs on Windows will fail in we launch JRuby via
    # ruby_exe() in-process (see core/argf/gets_spec.rb)
    JRuby.runtime.instance_config.run_ruby_in_process = false
    # core
    get(:core) << '^' + SPEC_DIR + '/core/file/stat' # many failures

    # exclude specs tagged with 'windows' keyword
    set :ci_xtags, ['windows']
  end

  # FIXME: add 1.9 library back at a later date
  set :ci_files, get(:language) + get(:core) + get(:command_line) #+ get(:library)

  # Optional library specs
  set :ffi, SPEC_DIR + '/optional/ffi'

  # A list of _all_ optional library specs
  set :optional, [get(:ffi)]

  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.9/ruby/language/'],
                        [%r(^.*/core/), TAGS_DIR + '/1.9/ruby/core/'],
                        [%r(^.*/command_line/), TAGS_DIR + '/1.9/ruby/command_line/'],
                        [%r(^.*/library/), TAGS_DIR + '/1.9/ruby/library/'],
                        [/_spec.rb$/, '_tags.txt']
                      ]
  # If running specs with jit threshold = 1 or force (AOT) compile, additional tags
  if JRuby.runtime.instance_config.compile_mode.to_s == "FORCE" ||
      JRuby.runtime.instance_config.jit_threshold == 1
    set(:ci_xtags, (get(:ci_xtags) || []) + ['compiler'])
  end
end
Something went wrong with that request. Please try again.