-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathRakefile
74 lines (63 loc) · 1.93 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
# -*- ruby -*-
#
# Copyright (C) 2013-2014 Droonga Project
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License version 2.1 as published by the Free Software Foundation.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
require "bundler/gem_helper"
require "packnga"
base_dir = File.join(File.dirname(__FILE__))
helper = Bundler::GemHelper.new(base_dir)
helper.install
spec = helper.gemspec
Packnga::DocumentTask.new(spec) do |task|
task.original_language = "en"
task.translate_languages = ["ja"]
end
def run_command_test(*options)
default_options = []
if ENV["TRAVIS"] == "true"
default_options.push("--timeout", "3")
end
ruby(File.join(File.dirname(__FILE__), "test", "command", "run-test.rb"),
*(default_options + options))
end
namespace :test do
desc "Run unit test"
task :unit do
ruby(File.join(File.dirname(__FILE__), "test", "unit", "run-test.rb"))
end
namespace :command do
desc "Run command test: default"
task :default do
run_command_test
end
desc "Run command test: single slice"
task :single_slice do
run_command_test("--config", "single_slice")
end
desc "Run command test: version1"
task :version1 do
run_command_test("--config", "version1")
end
end
end
desc "Run test"
task :test => [
"test:unit",
"test:command:default",
"test:command:single_slice",
"test:command:version1",
]
test_task = ENV["DEFAULT_TEST_TASK"] || "test"
task :default => test_task