diff options
Diffstat (limited to 'works/life/lanqiao-selection-match/python-gen-out.rb')
-rwxr-xr-x | works/life/lanqiao-selection-match/python-gen-out.rb | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/works/life/lanqiao-selection-match/python-gen-out.rb b/works/life/lanqiao-selection-match/python-gen-out.rb deleted file mode 100755 index b9edc69..0000000 --- a/works/life/lanqiao-selection-match/python-gen-out.rb +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env ruby - -require 'timeout' - -def run(no, count) - Dir.glob("./codes/*#{no}.py").each do |f| - count.times do |i| - in_file = "./generator/#{no}-#{i + 1}.in" - out_file = "#{f.sub('codes', 'out').sub('.py', '')}-#{i + 1}.out" - pid = Process.spawn "python3 #{f} < #{in_file} > #{out_file}" - Timeout.timeout(5) do - Process.wait pid - end - rescue Timeout::Error - puts "Timeout for #{f} when tests #{i + 1} case" - File.delete out_file - Process.kill 'KILL', pid - end - rescue StandardError - puts "Error for #{f}" - end -end - -run 'A', 3 -run 'B', 3 -run 'C', 4 |