This repository has been archived by the owner on Mar 26, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 41
/
spec.rake
53 lines (42 loc) · 1.5 KB
/
spec.rake
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
# Rake tasks that run the specs.
namespace :spec do
# NOTE: "-t m" handled in $MAGLEV_HOME/default.mspec
# Running all of the specs in one VM requires bigger tmp obj size
PSPEC = %{MAGLEV_OPTS="--tocsz 1000000 $MAGLEV_OPTS" #{ENV['MAGLEV_HOME']}/spec/mspec/bin/mspec }
desc "Run one rubyspec file: rake spec:run[spec/rubyspec/.../foo_spec.rb]"
task :run, :spec do |t, args|
check_spec_file(args.spec)
sh "#{PSPEC} -V #{args.spec}"
end
desc "Run ci specs: there should be NO failures and NO errors."
task :ci do
rm_f "rubyspec_temp/*"
sh "#{PSPEC} -V -G fails"
end
desc "Run ci specs, generating a rubyspec_report.xml with JUnit output."
task :ci_report do
rm_f "rubyspec_temp/*"
sh "#{PSPEC} -f j -V -G fails 2>&1 | tee rubyspec_report.out"
sh 'csplit rubyspec_report.out "%<?xml%" "/</testsuites/+1"'
sh "mv xx00 rubyspec_report.xml"
sh "rm xx01 rubyspec_report.out"
end
desc "Retag the ci files (works only with hacked mspec-tag.rb)"
task :retag do
sh "#{PSPEC} tag -G fails"
end
desc "Run failing specs and untag ones that now pass"
task :untag do
# sh "#{PSPEC} tag --del fails"
untag_script = File.expand_path("../untag.sh", __FILE__)
sh untag_script
end
desc "Run the named specs and tag the failing ones"
task :tag, :file do |t, args|
sh "#{PSPEC} tag -G fails #{args.file}"
end
def check_spec_file(f)
raise "No spec defined with: spec=..." unless f
raise "Can't find file #{f}" unless File.exists? f
end
end