Skip to content
Newer
Older
100644 117 lines (103 sloc) 3.43 KB
12e86e4 @nicksieger Update copyrights to 2012
nicksieger authored
1 #--
2 # Copyright (c) 2006-2012 Nick Sieger <nicksieger@gmail.com>
3 # See the file LICENSE.txt included with the distribution for
4 # software license details.
5 #++
6
131ed23 @nicksieger Make sure bundler gets loaded before ci_reporter loader
nicksieger authored
7 require 'bundler/setup'
8
8a2ce16 @nicksieger Prepare for 1.3.2 release
nicksieger authored
9 begin
10 require 'hoe'
847e42d @nicksieger Add a gemfile for easier install of dependencies
nicksieger authored
11 Hoe.plugin :rubyforge
1f39c76 @nicksieger - Make builder dependency explicit
nicksieger authored
12 require File.dirname(__FILE__) + '/lib/ci/reporter/version'
ef2e3dc @nicksieger Rakefile updated for recent hoe
nicksieger authored
13 hoe = Hoe.spec("ci_reporter") do |p|
14 p.version = CI::Reporter::VERSION
8a2ce16 @nicksieger Prepare for 1.3.2 release
nicksieger authored
15 p.rubyforge_name = "caldersphere"
f29353a @nicksieger More changes for README extension rename
nicksieger authored
16 p.readme_file = "README.rdoc"
8a2ce16 @nicksieger Prepare for 1.3.2 release
nicksieger authored
17 p.url = "http://caldersphere.rubyforge.org/ci_reporter"
18 p.author = "Nick Sieger"
19 p.email = "nick@nicksieger.com"
41786af @rsutphin Fix ref to README from gemspec.
rsutphin authored
20 p.readme_file = 'README.rdoc'
8a2ce16 @nicksieger Prepare for 1.3.2 release
nicksieger authored
21 p.summary = "CI::Reporter allows you to generate reams of XML for use with continuous integration systems."
22 p.changes = p.paragraphs_of('History.txt', 0..1).join("\n\n")
f29353a @nicksieger More changes for README extension rename
nicksieger authored
23 p.description = p.paragraphs_of('README.rdoc', 0...1).join("\n\n")
24 p.extra_rdoc_files += ["README.rdoc"]
8a2ce16 @nicksieger Prepare for 1.3.2 release
nicksieger authored
25 p.test_globs = ["spec/**/*_spec.rb"]
1f39c76 @nicksieger - Make builder dependency explicit
nicksieger authored
26 p.extra_deps << ['builder', ">= 2.1.2"]
e59f269 @nicksieger Release 1.7.1
nicksieger authored
27 p.clean_globs += ["spec/reports", "acceptance/reports"]
8a2ce16 @nicksieger Prepare for 1.3.2 release
nicksieger authored
28 end
a5302a5 @nicksieger Update README dates and switch to Darkfish RDoc
nicksieger authored
29 hoe.spec.rdoc_options += ["-SHN", "-f", "darkfish"]
30
31 task :gemspec do
32 File.open("#{hoe.name}.gemspec", "w") {|f| f << hoe.spec.to_ruby }
33 end
34 task :package => :gemspec
8a2ce16 @nicksieger Prepare for 1.3.2 release
nicksieger authored
35 rescue LoadError
36 puts "You really need Hoe installed to be able to package this gem"
37 end
bfdcd21 @nicksieger - Prepare for 1.0 release; last set of changes in current svn location
nicksieger authored
38
39 # Hoe insists on setting task :default => :test
40 # !@#$ no easy way to empty the default list of prerequisites
ef2e3dc @nicksieger Rakefile updated for recent hoe
nicksieger authored
41 # Leave my tasks alone, Hoe
42 %w(default spec rcov).each do |task|
fc3cef0 @nicksieger Get working with modern Cucumber, drop support for 0.3
nicksieger authored
43 next unless Rake::Task.task_defined?(task)
ef2e3dc @nicksieger Rakefile updated for recent hoe
nicksieger authored
44 Rake::Task[task].prerequisites.clear
45 Rake::Task[task].actions.clear
46 end
f30cd1b @nicksieger - first version of junit report formatter; should be able to be
nicksieger authored
47
25f3c95 @nicksieger Upgrade RCov to 1.0.0, only used on ruby_18
nicksieger authored
48 # RCov only on 1.8
49 if defined?(RUBY_ENGINE)
28d371d @nicksieger Tagging 1.5.1
nicksieger authored
50 task :default => :spec
51 else
52 task :default => :rcov
53 end
f30cd1b @nicksieger - first version of junit report formatter; should be able to be
nicksieger authored
54
423e7b5 @nicksieger The RSpec 2 upgrade. First pass, tests running under RSpec 1 and 2
nicksieger authored
55 RSpecTask = begin
56 require 'rspec/core/rake_task'
57 @spec_bin = 'rspec'
58 RSpec::Core::RakeTask
59 rescue LoadError
60 require 'spec/rake/spectask'
61 @spec_bin = 'spec'
62 Spec::Rake::SpecTask
bfdcd21 @nicksieger - Prepare for 1.0 release; last set of changes in current svn location
nicksieger authored
63 end
64
423e7b5 @nicksieger The RSpec 2 upgrade. First pass, tests running under RSpec 1 and 2
nicksieger authored
65 RSpecTask.new do |t|
ce1bdca @nicksieger Run specs in --color mode
nicksieger authored
66 t.rspec_opts = "--color"
423e7b5 @nicksieger The RSpec 2 upgrade. First pass, tests running under RSpec 1 and 2
nicksieger authored
67 end
68
69 RSpecTask.new("spec:rcov") do |t|
70 t.rcov_opts = ['--exclude gems/*']
1f39c76 @nicksieger - Make builder dependency explicit
nicksieger authored
71 t.rcov = true
bfdcd21 @nicksieger - Prepare for 1.0 release; last set of changes in current svn location
nicksieger authored
72 end
423e7b5 @nicksieger The RSpec 2 upgrade. First pass, tests running under RSpec 1 and 2
nicksieger authored
73
74 begin
75 require 'spec/rake/verify_rcov'
76 # so we don't confuse autotest
77 RCov::VerifyTask.new(:rcov) do |t|
78 # Can't get threshold up to 100 unless RSpec backwards compatibility
79 # code is dropped
bfdf923 @nicksieger More cleanup - require rubygems outside of the codebase
nicksieger authored
80 t.threshold = 95
423e7b5 @nicksieger The RSpec 2 upgrade. First pass, tests running under RSpec 1 and 2
nicksieger authored
81 t.require_exact_threshold = false
82 end
83 rescue LoadError
1f39c76 @nicksieger - Make builder dependency explicit
nicksieger authored
84 end
423e7b5 @nicksieger The RSpec 2 upgrade. First pass, tests running under RSpec 1 and 2
nicksieger authored
85
1f39c76 @nicksieger - Make builder dependency explicit
nicksieger authored
86 task :rcov => "spec:rcov"
6da80dc @nicksieger Add start of acceptance tests
nicksieger authored
87
88 task :generate_output do
8498d2c @mathie Turns out that the reports directory isn't getting nuked between test…
mathie authored
89 rm_rf "acceptance/reports"
6da80dc @nicksieger Add start of acceptance tests
nicksieger authored
90 ENV['CI_REPORTS'] = "acceptance/reports"
131ed23 @nicksieger Make sure bundler gets loaded before ci_reporter loader
nicksieger authored
91 if ENV['RUBYOPT']
92 opts = ENV['RUBYOPT']
93 ENV['RUBYOPT'] = nil
94 else
95 opts = "-rubygems"
96 end
6da80dc @nicksieger Add start of acceptance tests
nicksieger authored
97 begin
131ed23 @nicksieger Make sure bundler gets loaded before ci_reporter loader
nicksieger authored
98 result_proc = proc {|ok,*| puts "Failures above are expected." unless ok }
99 ruby "-Ilib #{opts} -rci/reporter/rake/test_unit_loader acceptance/test_unit_example_test.rb", &result_proc
a9d62ea @realmyst added acceptance spec
realmyst authored
100 ruby "-Ilib #{opts} -rci/reporter/rake/minitest_loader acceptance/minitest_example_test.rb", &result_proc
131ed23 @nicksieger Make sure bundler gets loaded before ci_reporter loader
nicksieger authored
101 ruby "-Ilib #{opts} -S #{@spec_bin} --require ci/reporter/rake/rspec_loader --format CI::Reporter::RSpec acceptance/rspec_example_spec.rb", &result_proc
102 ruby "-Ilib #{opts} -rci/reporter/rake/cucumber_loader -S cucumber --format CI::Reporter::Cucumber acceptance/cucumber", &result_proc
6da80dc @nicksieger Add start of acceptance tests
nicksieger authored
103 ensure
131ed23 @nicksieger Make sure bundler gets loaded before ci_reporter loader
nicksieger authored
104 ENV['RUBYOPT'] = opts if opts != "-rubygems"
6da80dc @nicksieger Add start of acceptance tests
nicksieger authored
105 ENV.delete 'CI_REPORTS'
106 end
107 end
108 task :acceptance => :generate_output
109
423e7b5 @nicksieger The RSpec 2 upgrade. First pass, tests running under RSpec 1 and 2
nicksieger authored
110 RSpecTask.new(:acceptance_spec) do |t|
111 t.pattern = FileList['acceptance/verification_spec.rb']
ce1bdca @nicksieger Run specs in --color mode
nicksieger authored
112 t.rspec_opts = "--color"
6da80dc @nicksieger Add start of acceptance tests
nicksieger authored
113 end
114 task :acceptance => :acceptance_spec
115
116 task :default => :acceptance
Something went wrong with that request. Please try again.