Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 111 lines (94 sloc) 3.095 kb
3edf44a Bret Pettichord fixing more line endings...
bret authored
1 require 'rubygems'
2 require 'rake/clean'
3 require 'fileutils'
4 require 'rake/testtask'
5 gem 'ci_reporter'
6 require 'ci/reporter/rake/test_unit'
7 projects = ['watir', 'firewatir', 'commonwatir']
8
9 desc "Generate all the Watir gems"
10 task :gems do
11 projects.each do |x|
12 Dir.chdir(x) {puts `rake.bat gem`}
13 end
14 FileUtils.makedirs 'gems'
15 gems = Dir['*/pkg/*.gem']
16 gems.each {|gem| FileUtils.install gem, 'gems'}
17 end
18
19 desc "Clean all the projects"
20 task :clean_subprojects do
21 projects.each do |x|
22 Dir.chdir(x) {puts `rake.bat clean`}
23 end
24 end
25
26 task :clean => [:clean_subprojects]
d4a23cb Bret Pettichord don't change chdir (permanently) in tests. this keeps test reports at to...
bret authored
27 CLEAN << 'gems/*' << 'test/reports'
3edf44a Bret Pettichord fixing more line endings...
bret authored
28
29 desc 'Run core_tests tests for IE'
30 Rake::TestTask.new :core_tests do |t|
31 t.test_files = FileList['watir/unittests/core_tests.rb']
32 t.verbose = true
33 end
34
35 desc 'Run mozilla_all_tests for FireFox'
36 Rake::TestTask.new :mozilla_all_tests do |t|
37 t.test_files = FileList['firewatir/unittests/mozilla_all_tests.rb']
38 t.verbose = true
39 end
40
053bb00 Jari Bakken Add WatirSpec submodule + load it in Rakefile if available.
jarib authored
41 #
42 # ------------------------------ watirspec -----------------------------------
43 #
44
45 if File.exist?(path = "spec/watirspec/watirspec.rake")
46 load path
47 end
48
49 namespace :watirspec do
50 desc 'Initialize and fetch the watirspec submodule'
51 task :init do
52 sh "git submodule init"
53 sh "git submodule update"
54 end
55 end
56
57 #
58 # ----------------------------------------------------------------------------
59 #
60
3edf44a Bret Pettichord fixing more line endings...
bret authored
61 namespace :cruise do
62 def add_style_sheet_to_reports(report_dir)
d4a23cb Bret Pettichord don't change chdir (permanently) in tests. this keeps test reports at to...
bret authored
63 Dir[report_dir].each do |f|
3edf44a Bret Pettichord fixing more line endings...
bret authored
64 sContent = File.readlines(f, '\n')
65 sContent.each do |line|
d4a23cb Bret Pettichord don't change chdir (permanently) in tests. this keeps test reports at to...
bret authored
66 line.sub!(/<\?xml version=\"1.0\" encoding=\"UTF-8\"\?>/,
67 "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<?xml-stylesheet type=\"text\/xsl\" href=\"transform-results.xsl\"?>")
3edf44a Bret Pettichord fixing more line endings...
bret authored
68 end
69 File.open(f, "w+") { |file| file.puts sContent }
70 end
71 end
72
d4a23cb Bret Pettichord don't change chdir (permanently) in tests. this keeps test reports at to...
bret authored
73 task :move_reports do
74 reports = "test/reports/*.xml"
75 add_style_sheet_to_reports(reports)
f96866b Jari Bakken Various adjustments to make Watir run on Ruby 1.9.
jarib authored
76 FileUtils.cp("transform-results.xsl", "test/reports")
d4a23cb Bret Pettichord don't change chdir (permanently) in tests. this keeps test reports at to...
bret authored
77 if ENV['CC_BUILD_ARTIFACTS']
f96866b Jari Bakken Various adjustments to make Watir run on Ruby 1.9.
jarib authored
78 Dir[reports].each { |e| FileUtils.cp(e, ENV['CC_BUILD_ARTIFACTS']) }
79 FileUtils.cp("transform-results.xsl", ENV['CC_BUILD_ARTIFACTS'])
d4a23cb Bret Pettichord don't change chdir (permanently) in tests. this keeps test reports at to...
bret authored
80 else
81 puts "Build results not copied. CC_BUILD_ARTIFACTS not defined"
82 end
3edf44a Bret Pettichord fixing more line endings...
bret authored
83 end
84
9229bfc Bret Pettichord provide test-by-test listing in the build log. 2nd try.
bret authored
85 task :verbose do
86 # ci:setup_testunit also mucks with this
87 ENV["TESTOPTS"] = "#{ENV["TESTOPTS"]} -v"
88 end
89
0f24e3a Bret Pettichord should not get an error when running cruise targets outside cruise. adde...
bret authored
90 desc 'Run tests for Internet Explorer'
9229bfc Bret Pettichord provide test-by-test listing in the build log. 2nd try.
bret authored
91 task :ie_core_tests => ['ci:setup:testunit', :verbose, :core_tests, :move_reports]
0f24e3a Bret Pettichord should not get an error when running cruise targets outside cruise. adde...
bret authored
92 desc 'Run tests for Firefox'
9229bfc Bret Pettichord provide test-by-test listing in the build log. 2nd try.
bret authored
93 task :ff_mozilla_all_tests => ['ci:setup:testunit', :verbose, :mozilla_all_tests, :move_reports]
54e12c2 Jari Bakken Add `rake cruise:all` to run tests for both FF and IE.
jarib authored
94
95 desc 'Run all tests'
96 task :all => [:ie_core_tests, :ff_mozilla_all_tests]
3edf44a Bret Pettichord fixing more line endings...
bret authored
97 end
98
99 desc 'Build the html for the website (wtr.rubyforge.org)'
100 task :website do
101 Dir.chdir 'doc' do
102 puts system('call webgen -V 1')
103 end
104 end
105
106 desc 'Build and publish the html for the website at wtr.rubyforge.org'
107 task :publish_website => [:website] do
108 user = 'bret' # userid on rubyforge
109 puts system("call pscp -v -r doc\\output\\*.* #{user}@rubyforge.org:/var/www/gforge-projects/wtr")
110 end
Something went wrong with that request. Please try again.