most 0.7.5 → 0.7.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History.txt +3 -0
- data/Manifest.txt +21 -0
- data/Rakefile +1 -3
- data/lib/most/context.rb +4 -0
- data/lib/most/environment.rb +7 -2
- data/lib/most/executor.rb +5 -5
- data/lib/most/helpers/numeric.rb +5 -0
- data/lib/most/structures/box.rb +38 -1
- data/lib/most/structures/submission.rb +5 -1
- data/lib/most/structures/test_case.rb +9 -0
- data/lib/most/structures/test_runner.rb +13 -0
- data/lib/most/structures/types/report.rb +1 -1
- data/lib/most/submissions/borland_delphi_sample.rb +36 -0
- data/lib/most/submissions/brainf_sample.rb +32 -0
- data/lib/most/submissions/cpp_memory_out_sample.rb +2 -2
- data/lib/most/submissions/cpp_sample.rb +2 -2
- data/lib/most/submissions/cpp_timeout_sample.rb +2 -2
- data/lib/most/submissions/cs_sample.rb +3 -3
- data/lib/most/submissions/custom_delphi_sample.rb +119 -0
- data/lib/most/submissions/erlang_sample.rb +3 -3
- data/lib/most/submissions/haskell_sample.rb +3 -3
- data/lib/most/submissions/java_sample.rb +3 -3
- data/lib/most/submissions/lisp_sample.rb +3 -3
- data/lib/most/submissions/lua_sample.rb +3 -3
- data/lib/most/submissions/ocaml_sample.rb +3 -3
- data/lib/most/submissions/pascal_sample.rb +3 -3
- data/lib/most/submissions/perl_sample.rb +3 -3
- data/lib/most/submissions/php_sample.rb +3 -3
- data/lib/most/submissions/python_sample.rb +3 -3
- data/lib/most/submissions/ruby_sample.rb +3 -3
- data/lib/most/submissions/vb_sample.rb +3 -3
- data/lib/most/tasks/general/win/borland_delphi.rb +73 -0
- data/lib/most/tasks/general/win/brainf.rb +69 -0
- data/lib/most/tasks/general/win/run.rb +45 -0
- data/lib/most.rb +1 -1
- data/samples/custom/ones/check.dpr +15 -0
- data/samples/custom/ones/ones_is.dpr +23 -0
- data/samples/custom/ones/ones_rs.dpr +25 -0
- data/samples/custom/ones/problem.xml +21 -0
- data/samples/custom/ones/tests/clean.bat +5 -0
- data/samples/custom/ones/tests/make.bat +9 -0
- data/samples/custom/ones/tests/make_answers.bat +30 -0
- data/samples/custom/ones/tests/ones_rs.exe +0 -0
- data/samples/custom/ones/tests/shuffle.dpr +31 -0
- data/samples/custom/ones/tests/shuffle.exe +0 -0
- data/samples/custom/ones/tests/tests.lst +69 -0
- data/samples/problem/solutions/brainf/main.b +1 -0
- data/samples/problem/solutions/brainf/tests.yml +19 -0
- data/samples/problem/solutions/delphi/main.dpr +5 -0
- data/samples/problem/solutions/delphi/tests.yml +19 -0
- data/tasks/samples.rb +1 -1
- metadata +23 -22
data/History.txt
CHANGED
data/Manifest.txt
CHANGED
@@ -31,10 +31,13 @@ lib/most/structures/test_runner.rb
|
|
31
31
|
lib/most/structures/types/options.rb
|
32
32
|
lib/most/structures/types/path.rb
|
33
33
|
lib/most/structures/types/report.rb
|
34
|
+
lib/most/submissions/borland_delphi_sample.rb
|
35
|
+
lib/most/submissions/brainf_sample.rb
|
34
36
|
lib/most/submissions/cpp_memory_out_sample.rb
|
35
37
|
lib/most/submissions/cpp_sample.rb
|
36
38
|
lib/most/submissions/cpp_timeout_sample.rb
|
37
39
|
lib/most/submissions/cs_sample.rb
|
40
|
+
lib/most/submissions/custom_delphi_sample.rb
|
38
41
|
lib/most/submissions/erlang_sample.rb
|
39
42
|
lib/most/submissions/haskell_sample.rb
|
40
43
|
lib/most/submissions/java_sample.rb
|
@@ -47,6 +50,8 @@ lib/most/submissions/php_sample.rb
|
|
47
50
|
lib/most/submissions/python_sample.rb
|
48
51
|
lib/most/submissions/ruby_sample.rb
|
49
52
|
lib/most/submissions/vb_sample.rb
|
53
|
+
lib/most/tasks/general/win/borland_delphi.rb
|
54
|
+
lib/most/tasks/general/win/brainf.rb
|
50
55
|
lib/most/tasks/general/win/cs.rb
|
51
56
|
lib/most/tasks/general/win/erlang.rb
|
52
57
|
lib/most/tasks/general/win/gcc.rb
|
@@ -60,13 +65,29 @@ lib/most/tasks/general/win/perl.rb
|
|
60
65
|
lib/most/tasks/general/win/php.rb
|
61
66
|
lib/most/tasks/general/win/python.rb
|
62
67
|
lib/most/tasks/general/win/ruby.rb
|
68
|
+
lib/most/tasks/general/win/run.rb
|
63
69
|
lib/most/tasks/general/win/vb.rb
|
64
70
|
lib/most/tasks/general/win/vc.rb
|
65
71
|
lib/most/tasks/general/win/vs.rb
|
72
|
+
samples/custom/ones/check.dpr
|
73
|
+
samples/custom/ones/ones_is.dpr
|
74
|
+
samples/custom/ones/ones_rs.dpr
|
75
|
+
samples/custom/ones/problem.xml
|
76
|
+
samples/custom/ones/tests/clean.bat
|
77
|
+
samples/custom/ones/tests/make.bat
|
78
|
+
samples/custom/ones/tests/make_answers.bat
|
79
|
+
samples/custom/ones/tests/ones_rs.exe
|
80
|
+
samples/custom/ones/tests/shuffle.dpr
|
81
|
+
samples/custom/ones/tests/shuffle.exe
|
82
|
+
samples/custom/ones/tests/tests.lst
|
83
|
+
samples/problem/solutions/brainf/main.b
|
84
|
+
samples/problem/solutions/brainf/tests.yml
|
66
85
|
samples/problem/solutions/cpp/main.cpp
|
67
86
|
samples/problem/solutions/cpp/tests.yml
|
68
87
|
samples/problem/solutions/cs/main.cs
|
69
88
|
samples/problem/solutions/cs/tests.yml
|
89
|
+
samples/problem/solutions/delphi/main.dpr
|
90
|
+
samples/problem/solutions/delphi/tests.yml
|
70
91
|
samples/problem/solutions/erlang/main.erl
|
71
92
|
samples/problem/solutions/erlang/tests.yml
|
72
93
|
samples/problem/solutions/haskell/main.hs
|
data/Rakefile
CHANGED
@@ -35,9 +35,7 @@ $hoe = Hoe.spec Most::UNIX_NAME do
|
|
35
35
|
self.post_install_message = File.read('PostInstall.txt')
|
36
36
|
self.readme_file = 'README.txt'
|
37
37
|
|
38
|
-
self.extra_deps = [['sys-proctable', '>= 0.9.0']
|
39
|
-
['open4', '>= 1.0.1'],
|
40
|
-
['win32-open3', '>= 0.3.1']]
|
38
|
+
self.extra_deps = [['sys-proctable', '>= 0.9.0']]
|
41
39
|
|
42
40
|
self.extra_dev_deps = [['newgem', '>= 1.5.1']]
|
43
41
|
end
|
data/lib/most/context.rb
CHANGED
data/lib/most/environment.rb
CHANGED
@@ -58,10 +58,15 @@ module Most
|
|
58
58
|
@logger.info(text)
|
59
59
|
end
|
60
60
|
|
61
|
-
def show_message(message, is_log_data =
|
62
|
-
puts
|
61
|
+
def show_message(message, is_log_data = true)
|
62
|
+
puts message unless @modes[:quiet]
|
63
63
|
log_message(message) if is_log_data
|
64
64
|
end
|
65
|
+
|
66
|
+
def state(message)
|
67
|
+
puts message if @modes[:verbose]
|
68
|
+
log_message(message)
|
69
|
+
end
|
65
70
|
end
|
66
71
|
|
67
72
|
end
|
data/lib/most/executor.rb
CHANGED
@@ -63,16 +63,16 @@ module Most
|
|
63
63
|
end
|
64
64
|
|
65
65
|
def output_version()
|
66
|
-
@environment.show_message("#{FULL_NAME} version #{VERSION}")
|
67
|
-
@environment.show_message("#{COPYRIGHT}")
|
66
|
+
@environment.show_message("#{FULL_NAME} version #{VERSION}", false)
|
67
|
+
@environment.show_message("#{COPYRIGHT}", false)
|
68
68
|
end
|
69
69
|
|
70
70
|
def output_options()
|
71
|
-
@environment.show_message("Available options: \n\n")
|
72
|
-
@environment.show_message("Usage: #{UNIX_NAME} {[option] [parameter]}")
|
71
|
+
@environment.show_message("Available options: \n\n", false)
|
72
|
+
@environment.show_message("Usage: #{UNIX_NAME} {[option] [parameter]}", false)
|
73
73
|
|
74
74
|
SERVICES[:starter].usage.each do |name, options|
|
75
|
-
@environment.show_message("\n\t#{options[2]}\n\t\t#{options[0]}, #{options[1]}")
|
75
|
+
@environment.show_message("\n\t#{options[2]}\n\t\t#{options[0]}, #{options[1]}", false)
|
76
76
|
end
|
77
77
|
end
|
78
78
|
end
|
data/lib/most/helpers/numeric.rb
CHANGED
data/lib/most/structures/box.rb
CHANGED
@@ -18,7 +18,9 @@
|
|
18
18
|
|
19
19
|
require 'time'
|
20
20
|
require 'yaml'
|
21
|
+
require "rexml/document"
|
21
22
|
require 'timeout'
|
23
|
+
require 'fileutils'
|
22
24
|
|
23
25
|
require 'most/helpers/memory_out'
|
24
26
|
|
@@ -55,6 +57,7 @@ module Most
|
|
55
57
|
|
56
58
|
include Timeout
|
57
59
|
include MemoryOut
|
60
|
+
include FileUtils
|
58
61
|
|
59
62
|
include BoxHelpers
|
60
63
|
|
@@ -74,7 +77,10 @@ module Most
|
|
74
77
|
end
|
75
78
|
|
76
79
|
def run(step)
|
77
|
-
|
80
|
+
SERVICES[:environment].state("#{6.w}Executing a test box #{object_id}")
|
81
|
+
SERVICES[:environment].state("#{6.w}Step type: #{step.class}")
|
82
|
+
|
83
|
+
result = Report.new("Box: #{object_id}")
|
78
84
|
|
79
85
|
if @options[:tests/:report/:specs]
|
80
86
|
result.specs = {:options => @options,
|
@@ -84,10 +90,41 @@ module Most
|
|
84
90
|
end
|
85
91
|
|
86
92
|
result << execute(step)
|
93
|
+
|
94
|
+
SERVICES[:environment].state("#{6.w}|--> Finished.")
|
95
|
+
|
87
96
|
result
|
88
97
|
end
|
89
98
|
|
90
99
|
private
|
100
|
+
def timeout_with_specs(sec, klass = nil, &block)
|
101
|
+
@result[:limits] ||= {}
|
102
|
+
@result[:limits][:time_limit] = sec
|
103
|
+
|
104
|
+
timeout(sec, klass, &block)
|
105
|
+
end
|
106
|
+
|
107
|
+
def memory_out_with_specs(bytes, pid = nil, precision = 0.1, klass = nil, &block)
|
108
|
+
@result[:limits] ||= {}
|
109
|
+
@result[:limits][:memory_limit] = bytes
|
110
|
+
|
111
|
+
memory_out(bytes, pid, precision, klass, &block)
|
112
|
+
end
|
113
|
+
|
114
|
+
def virtual_memory_out_with_specs(bytes, pid = nil, precision = 0.1, klass = nil, &block)
|
115
|
+
@result[:limits] ||= {}
|
116
|
+
@result[:limits][:virtual_memory_limit] = bytes
|
117
|
+
|
118
|
+
virtual_memory_out(bytes, pid, precision, klass, &block)
|
119
|
+
end
|
120
|
+
|
121
|
+
def total_memory_out_with_specs(bytes, pid = nil, precision = 0.1, klass = nil, &block)
|
122
|
+
@result[:limits] ||= {}
|
123
|
+
@result[:limits][:total_memory_limit] = bytes
|
124
|
+
|
125
|
+
total_memory_out(bytes, pid, precision, klass, &block)
|
126
|
+
end
|
127
|
+
|
91
128
|
def execute(step)
|
92
129
|
@result[:started] = Time.now
|
93
130
|
@result[:success] = true
|
@@ -89,7 +89,9 @@ module Most
|
|
89
89
|
end
|
90
90
|
|
91
91
|
def run()
|
92
|
-
SERVICES[:environment].
|
92
|
+
SERVICES[:environment].show_message("Working...")
|
93
|
+
SERVICES[:environment].state("Processing submission #{@name}")
|
94
|
+
SERVICES[:environment].state("Number of test cases: #{@tests.size}")
|
93
95
|
|
94
96
|
result = Report.new("Submission: #{@name}")
|
95
97
|
|
@@ -110,6 +112,8 @@ module Most
|
|
110
112
|
end
|
111
113
|
end
|
112
114
|
|
115
|
+
SERVICES[:environment].state("|--> Finished.")
|
116
|
+
|
113
117
|
result.to_yaml()
|
114
118
|
end
|
115
119
|
end
|
@@ -61,6 +61,8 @@ module Most
|
|
61
61
|
end
|
62
62
|
|
63
63
|
def run(options, entities)
|
64
|
+
SERVICES[:environment].state("#{2.w}Processing test case: #{@name}")
|
65
|
+
|
64
66
|
result = Report.new("Test Case: #{@name}")
|
65
67
|
|
66
68
|
if options[:tests/:report/:specs]
|
@@ -71,6 +73,12 @@ module Most
|
|
71
73
|
end
|
72
74
|
|
73
75
|
result << process(options, entities)
|
76
|
+
|
77
|
+
correct_status = result.last.last[:correct]; correct_status ||= false
|
78
|
+
message = "#{2.w}|--> Test case '#{@name}' correct?: #{correct_status}"
|
79
|
+
|
80
|
+
SERVICES[:environment].show_message(message)
|
81
|
+
|
74
82
|
result
|
75
83
|
end
|
76
84
|
|
@@ -78,6 +86,7 @@ module Most
|
|
78
86
|
def process(options, entities)
|
79
87
|
result = @runner.run(options, entities, @input)
|
80
88
|
|
89
|
+
result.last[:correct_output] = @output
|
81
90
|
if result.last[:success]
|
82
91
|
process_result!(result.last, options)
|
83
92
|
end
|
@@ -46,6 +46,9 @@ module Most
|
|
46
46
|
end
|
47
47
|
|
48
48
|
def run(options, entities, input)
|
49
|
+
SERVICES[:environment].state("#{4.w}Processing test runner #{@name}")
|
50
|
+
SERVICES[:environment].state("#{4.w}Number of steps: #{@steps.size}")
|
51
|
+
|
49
52
|
result = Report.new("Test Runner: #{@name}")
|
50
53
|
|
51
54
|
if options[:tests/:report/:specs]
|
@@ -54,6 +57,9 @@ module Most
|
|
54
57
|
end
|
55
58
|
|
56
59
|
result << execute(options, entities, input)
|
60
|
+
|
61
|
+
SERVICES[:environment].state("#{4.w}|--> Test run successful?: #{result.last[:success]}")
|
62
|
+
|
57
63
|
result
|
58
64
|
end
|
59
65
|
|
@@ -87,6 +93,13 @@ module Most
|
|
87
93
|
result[:steps] << step_box
|
88
94
|
result[:process_stdout] = step_result.last[:process_stdout]
|
89
95
|
|
96
|
+
limits = step_result.last[:limits]
|
97
|
+
|
98
|
+
unless limits.nil?
|
99
|
+
result[:limits] ||= []
|
100
|
+
result[:limits] << limits
|
101
|
+
end
|
102
|
+
|
90
103
|
unless step_result.last[:success]
|
91
104
|
if options[:tests/:steps/:break/:unsuccessful]
|
92
105
|
result[:success] = false
|
@@ -0,0 +1,36 @@
|
|
1
|
+
submission do
|
2
|
+
name 'Simple Borland Delphi Submission'
|
3
|
+
|
4
|
+
entities :source_file => path('main.dpr'), :executable => path('main.exe')
|
5
|
+
|
6
|
+
options :tests => {:report => {:differences => true, :time => true, :specs => false},
|
7
|
+
:steps => {:break => {:unsuccessful => true}}}
|
8
|
+
|
9
|
+
YAML.load_file('tests.yml').each_with_index do |specs, i|
|
10
|
+
|
11
|
+
add_test TestCase do
|
12
|
+
name "Test #{i + 1}"
|
13
|
+
|
14
|
+
input specs[:input]
|
15
|
+
output specs[:output]
|
16
|
+
|
17
|
+
runner TestRunner do
|
18
|
+
name 'Borland Delphi Runner'
|
19
|
+
|
20
|
+
add_step Proc do
|
21
|
+
rake_clean 'win:borland_delphi:compile', entities[:source_file]
|
22
|
+
end
|
23
|
+
|
24
|
+
add_step Proc do
|
25
|
+
timeout_with_specs specs[:time] do
|
26
|
+
total_memory_out_with_specs specs[:memory] do
|
27
|
+
rake_clean 'win:borland_delphi:run', entities[:executable], input
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
submission do
|
2
|
+
name 'Simple Brainf Submission'
|
3
|
+
|
4
|
+
entities :executable => path('main.b')
|
5
|
+
|
6
|
+
options :tests => {:report => {:differences => true, :time => true, :specs => false},
|
7
|
+
:steps => {:break => {:unsuccessful => true}}}
|
8
|
+
|
9
|
+
YAML.load_file('tests.yml').each_with_index do |specs, i|
|
10
|
+
|
11
|
+
add_test TestCase do
|
12
|
+
name "Test #{i + 1}"
|
13
|
+
|
14
|
+
input specs[:input]
|
15
|
+
output specs[:output]
|
16
|
+
|
17
|
+
runner TestRunner do
|
18
|
+
name 'Brainf Runner'
|
19
|
+
|
20
|
+
add_step Proc do
|
21
|
+
timeout_with_specs specs[:time] do
|
22
|
+
total_memory_out_with_specs specs[:memory] do
|
23
|
+
rake_clean 'win:brainf:run', entities[:executable], input
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
end
|
@@ -3,7 +3,7 @@ submission do
|
|
3
3
|
|
4
4
|
entities :source_file => path('main.cpp'), :executable => path('main.exe')
|
5
5
|
|
6
|
-
options :tests => {:report => {:differences => true, :time => true, :specs =>
|
6
|
+
options :tests => {:report => {:differences => true, :time => true, :specs => false},
|
7
7
|
:steps => {:break => {:unsuccessful => true}}}
|
8
8
|
|
9
9
|
YAML.load_file('tests.yml').each_with_index do |specs, i|
|
@@ -22,7 +22,7 @@ submission do
|
|
22
22
|
end
|
23
23
|
|
24
24
|
add_step Proc do
|
25
|
-
|
25
|
+
total_memory_out_with_specs 10.megabytes do
|
26
26
|
rake_clean 'win:vc:run', entities[:executable], input
|
27
27
|
end
|
28
28
|
end
|
@@ -22,8 +22,8 @@ submission do
|
|
22
22
|
end
|
23
23
|
|
24
24
|
add_step Proc do
|
25
|
-
|
26
|
-
|
25
|
+
timeout_with_specs specs[:time] do
|
26
|
+
total_memory_out_with_specs specs[:memory] do
|
27
27
|
rake_clean 'win:vc:run', entities[:executable], input
|
28
28
|
end
|
29
29
|
end
|
@@ -3,7 +3,7 @@ submission do
|
|
3
3
|
|
4
4
|
entities :source_file => path('main.cpp'), :executable => path('main.exe')
|
5
5
|
|
6
|
-
options :tests => {:report => {:differences => true, :time => true, :specs =>
|
6
|
+
options :tests => {:report => {:differences => true, :time => true, :specs => false},
|
7
7
|
:steps => {:break => {:unsuccessful => true}}}
|
8
8
|
|
9
9
|
YAML.load_file('tests.yml').each_with_index do |specs, i|
|
@@ -22,7 +22,7 @@ submission do
|
|
22
22
|
end
|
23
23
|
|
24
24
|
add_step Proc do
|
25
|
-
|
25
|
+
timeout_with_specs 5.seconds do
|
26
26
|
rake_clean 'win:vc:run', entities[:executable], input
|
27
27
|
end
|
28
28
|
end
|
@@ -3,7 +3,7 @@ submission do
|
|
3
3
|
|
4
4
|
entities :source_file => path('main.cs'), :executable => path('main.exe')
|
5
5
|
|
6
|
-
options :tests => {:report => {:differences => true, :time => true, :specs =>
|
6
|
+
options :tests => {:report => {:differences => true, :time => true, :specs => false},
|
7
7
|
:steps => {:break => {:unsuccessful => true}}}
|
8
8
|
|
9
9
|
YAML.load_file('tests.yml').each_with_index do |specs, i|
|
@@ -22,8 +22,8 @@ submission do
|
|
22
22
|
end
|
23
23
|
|
24
24
|
add_step Proc do
|
25
|
-
|
26
|
-
|
25
|
+
timeout_with_specs specs[:time] do
|
26
|
+
total_memory_out_with_specs specs[:memory] do
|
27
27
|
rake_clean 'win:cs:run', entities[:executable], input
|
28
28
|
end
|
29
29
|
end
|
@@ -0,0 +1,119 @@
|
|
1
|
+
submission do
|
2
|
+
specs = REXML::Document.new(File.new('problem.xml')).elements['problem/judging/script/testset']
|
3
|
+
|
4
|
+
problem_name = Dir.pwd().split(/[\\|\/]/).last()
|
5
|
+
|
6
|
+
number_of_tests = specs.attributes['test-count'].to_i()
|
7
|
+
|
8
|
+
input_files = Dir[specs.attributes['input-href'].gsub('#', '[0-9]').chomp('.')]
|
9
|
+
answer_files = Dir[specs.attributes['answer-href'].gsub('#', '[0-9]').chomp('.')]
|
10
|
+
|
11
|
+
input_file = specs.attributes['input-name']
|
12
|
+
output_file = specs.attributes['output-name']
|
13
|
+
|
14
|
+
time_limit = specs.attributes['time-limit'].downcase
|
15
|
+
if time_limit['ms']
|
16
|
+
time_limit = time_limit.gsub('ms', '').to_i().milliseconds
|
17
|
+
elsif time_limit['s']
|
18
|
+
time_limit = time_limit.gsub('s', '').to_i()
|
19
|
+
elsif time_limit['m']
|
20
|
+
time_limit = time_limit.gsub('m', '').to_i().minutes
|
21
|
+
elsif time_limit['m']
|
22
|
+
time_limit = time_limit.gsub('h', '').to_i().hours
|
23
|
+
end
|
24
|
+
|
25
|
+
memory_limit = specs.attributes['memory-limit'].to_i()
|
26
|
+
|
27
|
+
name "Custom Borland Delphi Submission: #{problem_name}"
|
28
|
+
|
29
|
+
entities :problem_name => problem_name,
|
30
|
+
|
31
|
+
:checker => path('check.dpr'), :checker_executable => path('check.exe'),
|
32
|
+
:source => path("#{problem_name}_is.dpr"), :executable => path("#{problem_name}_is.exe"),
|
33
|
+
|
34
|
+
:input_file => path(input_file),
|
35
|
+
:output_file => path(output_file),
|
36
|
+
:answer_file => path("#{problem_name}.a"),
|
37
|
+
|
38
|
+
:result_file => path('result.xml'),
|
39
|
+
|
40
|
+
:input_files => input_files,
|
41
|
+
:answer_files => answer_files
|
42
|
+
|
43
|
+
options :tests => {:report => {:differences => true, :time => true, :specs => false},
|
44
|
+
:steps => {:break => {:unsuccessful => true}}}
|
45
|
+
|
46
|
+
entities = entities()
|
47
|
+
|
48
|
+
1.upto(number_of_tests) do |i|
|
49
|
+
|
50
|
+
add_test TestCase do
|
51
|
+
name "Test #{i}"
|
52
|
+
|
53
|
+
input path(entities[:input_file])
|
54
|
+
output 'testlib: accepted'
|
55
|
+
|
56
|
+
output_destination entities[:result_file]
|
57
|
+
|
58
|
+
output_preprocessor Proc do |text|
|
59
|
+
'testlib: ' + REXML::Document.new(text).elements['result'].
|
60
|
+
attributes['outcome'].
|
61
|
+
strip().
|
62
|
+
downcase() rescue text
|
63
|
+
end
|
64
|
+
|
65
|
+
runner TestRunner do
|
66
|
+
name 'Custom Borland Delphi Runner'
|
67
|
+
|
68
|
+
add_step Proc do
|
69
|
+
rake_clean 'win:borland_delphi:compile', entities[:checker]
|
70
|
+
end
|
71
|
+
|
72
|
+
add_step Proc do
|
73
|
+
rake_clean 'win:borland_delphi:compile', entities[:source]
|
74
|
+
end
|
75
|
+
|
76
|
+
add_step Proc do
|
77
|
+
rake_clean 'win:borland_delphi:compile', entities[:source]
|
78
|
+
end
|
79
|
+
|
80
|
+
add_step Proc do
|
81
|
+
if entities[:input_files].size != number_of_tests or
|
82
|
+
entities[:answer_files].size != number_of_tests
|
83
|
+
STDOUT.puts 'buba'
|
84
|
+
|
85
|
+
rake 'win:run', 'cd tests && make'
|
86
|
+
|
87
|
+
entities[:input_files] = Dir[specs.attributes['input-href'].gsub('#', '[0-9]').chomp('.')]
|
88
|
+
entities[:answer_files] = Dir[specs.attributes['answer-href'].gsub('#', '[0-9]').chomp('.')]
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
add_step Proc do
|
93
|
+
cp entities[:input_files][i - 1], File.join(Dir.pwd, entities[:input_file])
|
94
|
+
cp entities[:answer_files][i - 1], File.join(Dir.pwd, entities[:answer_file])
|
95
|
+
end
|
96
|
+
|
97
|
+
add_step Proc do
|
98
|
+
timeout_with_specs time_limit do
|
99
|
+
total_memory_out_with_specs memory_limit do
|
100
|
+
rake_clean 'win:borland_delphi:run', entities[:executable], input
|
101
|
+
end
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
105
|
+
add_step Proc do
|
106
|
+
rake 'win:run', entities[:checker_executable],
|
107
|
+
"#{entities[:input_file]} " +
|
108
|
+
"#{entities[:output_file]} " +
|
109
|
+
"#{entities[:answer_file]} #{entities[:result_file]} -xml"
|
110
|
+
|
111
|
+
rm [entities[:input_file],
|
112
|
+
entities[:output_file],
|
113
|
+
entities[:answer_file]], :force => true
|
114
|
+
end
|
115
|
+
end
|
116
|
+
end
|
117
|
+
|
118
|
+
end
|
119
|
+
end
|
@@ -3,7 +3,7 @@ submission do
|
|
3
3
|
|
4
4
|
entities :source_file => path('main.erl'), :entry_function => path('main')
|
5
5
|
|
6
|
-
options :tests => {:report => {:differences => true, :time => true, :specs =>
|
6
|
+
options :tests => {:report => {:differences => true, :time => true, :specs => false},
|
7
7
|
:steps => {:break => {:unsuccessful => true}}}
|
8
8
|
|
9
9
|
YAML.load_file('tests.yml').each_with_index do |specs, i|
|
@@ -22,8 +22,8 @@ submission do
|
|
22
22
|
end
|
23
23
|
|
24
24
|
add_step Proc do
|
25
|
-
|
26
|
-
|
25
|
+
timeout_with_specs specs[:time] do
|
26
|
+
total_memory_out_with_specs specs[:memory] do
|
27
27
|
rake_clean 'win:erlang:run', entities[:entry_function], input
|
28
28
|
end
|
29
29
|
end
|
@@ -3,7 +3,7 @@ submission do
|
|
3
3
|
|
4
4
|
entities :source_file => path('main.hs'), :executable => path('main.exe')
|
5
5
|
|
6
|
-
options :tests => {:report => {:differences => true, :time => true, :specs =>
|
6
|
+
options :tests => {:report => {:differences => true, :time => true, :specs => false},
|
7
7
|
:steps => {:break => {:unsuccessful => true}}}
|
8
8
|
|
9
9
|
YAML.load_file('tests.yml').each_with_index do |specs, i|
|
@@ -22,8 +22,8 @@ submission do
|
|
22
22
|
end
|
23
23
|
|
24
24
|
add_step Proc do
|
25
|
-
|
26
|
-
|
25
|
+
timeout_with_specs specs[:time] do
|
26
|
+
total_memory_out_with_specs specs[:memory] do
|
27
27
|
rake_clean 'win:haskell:run', entities[:executable], input
|
28
28
|
end
|
29
29
|
end
|
@@ -3,7 +3,7 @@ submission do
|
|
3
3
|
|
4
4
|
entities :source_file => path('Main.java'), :executable => path('Main')
|
5
5
|
|
6
|
-
options :tests => {:report => {:differences => true, :time => true, :specs =>
|
6
|
+
options :tests => {:report => {:differences => true, :time => true, :specs => false},
|
7
7
|
:steps => {:break => {:unsuccessful => true}}}
|
8
8
|
|
9
9
|
YAML.load_file('tests.yml').each_with_index do |specs, i|
|
@@ -22,8 +22,8 @@ submission do
|
|
22
22
|
end
|
23
23
|
|
24
24
|
add_step Proc do
|
25
|
-
|
26
|
-
|
25
|
+
timeout_with_specs specs[:time] do
|
26
|
+
total_memory_out_with_specs specs[:memory] do
|
27
27
|
rake_clean 'win:java:run', entities[:executable], input
|
28
28
|
end
|
29
29
|
end
|
@@ -3,7 +3,7 @@ submission do
|
|
3
3
|
|
4
4
|
entities :executable => path('main.lisp')
|
5
5
|
|
6
|
-
options :tests => {:report => {:differences => true, :time => true, :specs =>
|
6
|
+
options :tests => {:report => {:differences => true, :time => true, :specs => false},
|
7
7
|
:steps => {:break => {:unsuccessful => true}}}
|
8
8
|
|
9
9
|
YAML.load_file('tests.yml').each_with_index do |specs, i|
|
@@ -18,8 +18,8 @@ submission do
|
|
18
18
|
name 'Lisp Runner'
|
19
19
|
|
20
20
|
add_step Proc do
|
21
|
-
|
22
|
-
|
21
|
+
timeout_with_specs specs[:time] do
|
22
|
+
total_memory_out_with_specs specs[:memory] do
|
23
23
|
rake_clean 'win:lisp:run', entities[:executable], input
|
24
24
|
end
|
25
25
|
end
|
@@ -3,7 +3,7 @@ submission do
|
|
3
3
|
|
4
4
|
entities :source_file => path('main.lua'), :executable => path('main.out')
|
5
5
|
|
6
|
-
options :tests => {:report => {:differences => true, :time => true, :specs =>
|
6
|
+
options :tests => {:report => {:differences => true, :time => true, :specs => false},
|
7
7
|
:steps => {:break => {:unsuccessful => true}}}
|
8
8
|
|
9
9
|
YAML.load_file('tests.yml').each_with_index do |specs, i|
|
@@ -22,8 +22,8 @@ submission do
|
|
22
22
|
end
|
23
23
|
|
24
24
|
add_step Proc do
|
25
|
-
|
26
|
-
|
25
|
+
timeout_with_specs specs[:time] do
|
26
|
+
total_memory_out_with_specs specs[:memory] do
|
27
27
|
rake_clean 'win:lua:run', entities[:executable], input
|
28
28
|
end
|
29
29
|
end
|