-
Notifications
You must be signed in to change notification settings - Fork 193
/
macruby.mspec
87 lines (71 loc) · 2.85 KB
/
macruby.mspec
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
class MSpecScript
# TODO: This doesn't work correctly yet.
# load File.expand_path('../frozen/ruby.1.9.mspec', __FILE__)
FROZEN_PREFIX = 'spec/frozen'
load File.join(FROZEN_PREFIX, 'ruby.1.9.mspec')
# Command-line specs
set :command_line, ['command_line']
# Core library specs
set :core, [
'core',
# obsolete in 1.9
'^core/continuation',
'^core/kernel/callcc_spec.rb',
# Currently not working on MacRuby
'^core/io'
]
# Library specs
set :library, [
'library',
# Obsolete in 1.9
'^library/fiber', # now part of core
'^library/syslog',
# Not supported in MacRuby
'^library/continuation',
# Tons of IO issues
'^library/net/ftp', # exists the specs when running using rake spec:library and reaching net/ftp/chdir_spec.rb
# Currently not working on MacRuby
'^library/cgi/htmlextension', # runs fine when run separately, it seems another spec brings IO in a wrong state
'^library/erb/new_spec.rb', # Loading issues
'^library/prime/each_spec.rb', # hangs because of timeout, but if the spec is tagged, crashes at the end, even when tagging everything
]
# Prepend the paths with the proper prefix
[:command_line, :language, :core, :library].each do |pseudo_dir|
set(pseudo_dir, get(pseudo_dir).map do |path|
if path[0,1] == '^'
"^#{File.join(FROZEN_PREFIX, path[1..-1])}"
else
File.join(FROZEN_PREFIX, path)
end
end)
end
set :macruby, ['spec/macruby']
set :irb, ['spec/dietrb']
set :rubyspec, get(:command_line) + get(:language) + get(:core) + get(:library)
set :full, get(:macruby) + get(:rubyspec)
# Optional library specs
set :ffi, File.join(FROZEN_PREFIX, 'optional/ffi')
# A list of _all_ optional library specs
set :optional, [get(:ffi)]
# Don't run with macruby if this env var is set
unless ENV['RUN_WITH_MRI_19']
# Make the macruby binary look for the framework in the source root
source_root = File.expand_path('../../', __FILE__)
ENV['DYLD_LIBRARY_PATH'] = source_root
# Setup the proper load paths for lib and extensions
load_paths = %w{ -I. -I./lib -I./ext }
load_paths << '-I./ext/ripper/lib' # ripper specific load path fix
load_paths.concat Dir.glob('./ext/**/*.bundle').map { |filename| "-I#{File.dirname(filename)}" }.uniq
load_paths.concat(get(:flags)) if get(:flags)
set :flags, load_paths
# The default implementation to run the specs.
set :target, File.join(source_root, 'macruby')
end
set :tags_patterns, [
[%r(language/), 'tags/macruby/language/'],
[%r(core/), 'tags/macruby/core/'],
[%r(library/), 'tags/macruby/library/'],
[%r(dietrb/), 'dietrb/tags/'],
[/_spec.rb$/, '_tags.txt']
]
end