-
Notifications
You must be signed in to change notification settings - Fork 3
/
Rakefile
54 lines (43 loc) · 1.34 KB
/
Rakefile
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
require 'bundler/gem_tasks'
require 'rake/extensiontask'
Rake::ExtensionTask.new('sockaddr') do |ext|
ext.lib_dir = "lib/eventless"
ext.ext_dir = "ext/sockaddr"
end
SPECS = [
"test/rubyspec/library/socket/basicsocket",
"test/rubyspec/library/socket/constants",
#"test/rubyspec/library/mutex", <- wierd error, choosing to ignore for now
]
namespace :spec do
desc "Ensure spec dependencies are installed"
task :deps do
sh "git submodule init"
sh "git submodule update"
end
end
if Dir['test/mspec/*'].empty? or Dir['test/rubyspec/*'].empty?
task :spec do
abort "Run `rake spec:deps` to be able to run the specs"
end
else
desc "Run specs"
task :spec do
# eventually, we should be able to run this... maybe :)
# sh "test/mspec/bin/mspec -t #{ENV["TARGET"] || "ruby" } -Ilib -reventless -reventless/thread test/rubyspec/library/socket/"
sh "test/mspec/bin/mspec -t #{ENV["TARGET"] || "ruby" } -Ilib -reventless -reventless/thread #{SPECS.join(" ")}"
# run without eventless
#sh "test/mspec/bin/mspec -t #{ENV["TARGET"] || "ruby" } #{SPECS.join(" ")}"
end
end
desc "load eventless in a pry or irb session (alias `rake c`)"
task :console do
if system("which pry")
repl = "pry"
else
repl = "irb"
end
sh "#{repl} -rubygems -r'bundler/setup' -reventless"
end
task :c => :console
task :default => :spec