diff options
author | Yuqian Yang <crupest@crupest.life> | 2025-02-28 23:13:39 +0800 |
---|---|---|
committer | Yuqian Yang <crupest@crupest.life> | 2025-02-28 23:13:39 +0800 |
commit | 99e2e923d0c77b02f3fb4ff648ea916954868606 (patch) | |
tree | ec8e03f6f2cd1ce43990fb4fe6cd631967d0237e /works/life/lanqiao-selection-match/cpp-gen-out.rb | |
parent | 1cee979f5d36b311a03cc7397a036ba11caf3d42 (diff) | |
download | crupest-99e2e923d0c77b02f3fb4ff648ea916954868606.tar.gz crupest-99e2e923d0c77b02f3fb4ff648ea916954868606.tar.bz2 crupest-99e2e923d0c77b02f3fb4ff648ea916954868606.zip |
chore(store): move everything to store.
Diffstat (limited to 'works/life/lanqiao-selection-match/cpp-gen-out.rb')
-rwxr-xr-x | works/life/lanqiao-selection-match/cpp-gen-out.rb | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/works/life/lanqiao-selection-match/cpp-gen-out.rb b/works/life/lanqiao-selection-match/cpp-gen-out.rb deleted file mode 100755 index 48ad68a..0000000 --- a/works/life/lanqiao-selection-match/cpp-gen-out.rb +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env ruby - -require 'timeout' - -def run(no, count) - Dir.glob("./build/*#{no}").each do |f| - count.times do |i| - in_file = "./generator/#{no}-#{i + 1}.in" - out_file = "#{f.sub('build', 'out')}-#{i + 1}.out" - pid = Process.spawn "#{f} < #{in_file} > #{out_file}" - Timeout.timeout(1) 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 - end -end - -run 'A', 3 -run 'B', 3 -run 'C', 4 |