-
Notifications
You must be signed in to change notification settings - Fork 21
/
Rakefile
37 lines (29 loc) · 998 Bytes
/
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
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec)
desc 'Run RSpec examples excepting those marked as slow'
RSpec::Core::RakeTask.new(:spec_fast) do |t|
t.rspec_opts = '--tag ~slow'
end
EXECUTABLE = 'ruby -Ilib bin/calendariumrom'
desc 'Run specs with each fully supported locale'
task :spec_all_locales do
%w(en la cs fr it pt).each do |locale|
sh "LOCALE=#{locale} rake spec"
end
end
desc 'Generates calendar dumps for regression tests anew'
task :regression_refresh do
2020.upto(2030).each do |year|
sh "#{EXECUTABLE} dump #{year} > spec/regression_dumps/#{year}.txt"
end
a = 2000
b = 2100
sh "#{EXECUTABLE} dump_transfers #{a} #{b} > spec/regression_dumps/transfers_#{a}_#{b}.txt"
end
desc 'Checks that all versions of the General Roman Calendar are the same'
task :data_cmp do
vernacular = Dir['data/universal-*.txt'].delete_if {|f| f.end_with? '-la.txt' }
vernacular.each do |f|
sh "#{EXECUTABLE} cmp data/universal-la.txt #{f}"
end
end