Description:
Merge branch 'master' of gitorious.org:cafe-grader/cafe-grader-judge-scripts into win-local
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r106:502201e59a2c - - 1 file changed: 2 inserted, 0 deleted
@@ -1,26 +1,28 | |||
|
1 | 1 | #!/usr/bin/ruby |
|
2 | 2 | |
|
3 | + require 'fileutils' | |
|
4 | + | |
|
3 | 5 | def log(str='') |
|
4 | 6 | if ENV['TALKATIVE']!=nil |
|
5 | 7 | puts str |
|
6 | 8 | end |
|
7 | 9 | if ENV['GRADER_LOGGING']!=nil |
|
8 | 10 | log_fname = ENV['GRADER_LOGGING'] |
|
9 | 11 | fp = File.open(log_fname,"a") |
|
10 | 12 | fp.puts("run: #{Time.new.strftime("%H:%M")} #{str}") |
|
11 | 13 | fp.close |
|
12 | 14 | end |
|
13 | 15 | end |
|
14 | 16 | |
|
15 | 17 | def extract_time(t) |
|
16 | 18 | # puts "TIME: #{t}" |
|
17 | 19 | if (result=/^(.*)r(.*)u(.*)s/.match(t)) |
|
18 | 20 | {:real => result[1], :user => result[2], :sys => result[3]} |
|
19 | 21 | else |
|
20 | 22 | #{:real => 0, :user => 0, :sys => 0} |
|
21 | 23 | #puts "ERROR READING RUNNING TIME: #{t}" |
|
22 | 24 | raise "Error reading running time: #{t}" |
|
23 | 25 | end |
|
24 | 26 | end |
|
25 | 27 | |
|
26 | 28 | def compile_box(source,bin) |
You need to be logged in to leave comments.
Login now