File: jruby.1.9.mspec

package info (click to toggle)
jruby 1.7.26-1%2Bdeb9u1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 84,572 kB
  • sloc: ruby: 669,910; java: 253,056; xml: 35,152; ansic: 9,187; yacc: 7,267; cpp: 5,244; sh: 1,036; makefile: 345; jsp: 48; tcl: 40
file content (134 lines) | stat: -rw-r--r-- 4,461 bytes parent folder | download
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# Default RubySpec/CI settings for JRuby in 1.9 mode.

# detect windows platform:
require 'rbconfig'
require 'java'
require 'jruby'
require 'mspec/runner/formatters'

IKVM = java.lang.System.get_property('java.vm.name') =~ /IKVM\.NET/
WINDOWS = RbConfig::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)

# update env to force children into proper mode
ENV['JRUBY_OPTS'] = ENV['JRUBY_OPTS'].to_s + " --1.9"

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'
  ]

  set :fast, [
    *get(:language),
    *get(:core),

    # These all spawn sub-rubies, making them very slow to run
    '^' + SPEC_DIR + '/core/process',
    '^' + SPEC_DIR + '/core/kernel/exec',
    '^' + SPEC_DIR + '/core/kernel/spawn',
    '^' + SPEC_DIR + '/core/io/popen',
    '^' + SPEC_DIR + '/core/argf/gets_spec.rb',
    '^' + SPEC_DIR + '/core/argf/read_spec.rb',
    '^' + SPEC_DIR + '/core/argf/readline_spec.rb',
    '^' + SPEC_DIR + '/core/encoding/default_external_spec.rb',
    '^' + SPEC_DIR + '/core/encoding/default_internal_spec.rb',
    '^' + SPEC_DIR + '/core/io/pid_spec.rb',
    '^' + SPEC_DIR + '/core/kernel/at_exit_spec.rb',
    '^' + SPEC_DIR + '/language/break_spec.rb',
    '^' + SPEC_DIR + '/language/predefined_spec.rb',
    '^' + SPEC_DIR + '/language/predefined/data_spec.rb',
  ]

  # 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/net',
    '^' + SPEC_DIR + '/library/openssl',

    # unstable
    '^' + SPEC_DIR + '/library/syslog',

    # masked out because of load-time errors that can't be tagged
    '^' + SPEC_DIR + '/library/net/http'
  ]

  # 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

  # prepare additional tags for CI
  set(:ci_xtags, ["java#{ENV_JAVA['java.specification.version']}"]) # Java version

  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
    get(:ci_xtags) << 'windows'
  end

  # This set of files is run by mspec ci
  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/' + RbConfig::CONFIG['ruby_install_name'] + RbConfig::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