-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathRakefile
85 lines (63 loc) · 1.91 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
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
# $Id: Rakefile 3546 2006-12-31 21:01:27Z francis $
# Rakefile for the Bayshore configurable LDAP server.
#
require 'rake/gempackagetask'
require 'rake/clean'
$can_minitar = false
begin
require 'archive/tar/minitar'
require 'zlib'
$can_minitar = true
rescue LoadError
end
$version = "0.0.1"
$distdir = "eventmachine_xmlpushparser-#{$version}"
$tardist = "#$distdir.tar.gz"
$name = "eventmachine_xmlpushparser"
spec = eval(File.read("eventmachine_xmlpushparser.gemspec"))
spec.version = $version
desc "Build the RubyGem for EventMachine XML push-parser"
task :gem => ["pkg/eventmachine_xmlpushparser-#{$version}.gem"]
Rake::GemPackageTask.new(spec) do |g|
if $can_minitar
g.need_tar = true
g.need_zip = true
end
g.package_dir = "pkg"
end
specbinary = eval(File.read("eventmachine_xmlpushparser-binary.gemspec"))
specbinary.version = $version
desc "Build a binary RubyGem for EventMachine XML push-parser"
task :gembinary => ["pkg/eventmachine_xmlpushparser-binary-#{$version}.gem"]
Rake::GemPackageTask.new(specbinary) do |g|
if $can_minitar
g.need_tar = true
g.need_zip = true
end
g.package_dir = "pkg"
end
def run_test_package test, filename_array
require 'test/unit/testsuite'
require 'test/unit/ui/console/testrunner'
runner = Test::Unit::UI::Console::TestRunner
$LOAD_PATH.unshift('test')
$stderr.puts "Checking for test cases:" if test.verbose
filename_array.each do |testcase|
$stderr.puts "\t#{testcase}" if test.verbose
load testcase
end
suite = Test::Unit::TestSuite.new($name)
ObjectSpace.each_object(Class) do |testcase|
suite << testcase.suite if testcase < Test::Unit::TestCase
end
runner.run(suite)
end
desc "Run the tests for #$name."
task :test do |t|
run_test_package t, Dir['test/*.rb']
end
desc "Run the application tests"
task :test_application do |t|
run_test_package t, Dir['test/app.rb']
end
task :default => [:test]