-
Notifications
You must be signed in to change notification settings - Fork 193
/
macruby.mspec
84 lines (72 loc) · 2.72 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
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')
# Core library specs
set :core, [
'core',
# obsolete in 1.9
'^core/continuation',
'^core/kernel/callcc_spec.rb',
# Currently not working on MacRuby
'^core/encoding'
]
# Library specs
set :library, [
'library',
# Currently not working on MacRuby
'^library/erb',
'^library/iconv',
'^library/generator',
'^library/openssl',
'^library/net/http', # due to '/fixtures/http_server' loaded in net/http/http/active_spec.rb (webrick)
'^library/net/ftp', # exists the specs when running using rake spec:library and reaching net/ftp/chdir_spec.rb
'^library/prime', # hangs probably because of timeout
'^library/set', # sortedset is segfaulting
'^library/syslog',
# disabled the zlib specs for now because of a random GC crash
# that seems to occur in gzipfile/closed_spec.rb
'^library/zlib/adler32_spec.rb',
'^library/zlib/crc32_spec.rb',
'^library/zlib/crc_table_spec.rb',
'^library/zlib/deflate',
'^library/zlib/inflate'
]
# Prepend the paths with the proper prefix
[: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 :rubyspec, 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)]
# All setup needed to run the specs from the macruby source root.
#
#
# 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.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')
set :tags_patterns, [
[%r(language/), 'tags/macruby/language/'],
[%r(core/), 'tags/macruby/core/'],
[%r(library/), 'tags/macruby/library/'],
[/_spec.rb$/, '_tags.txt']
]
end