Added an way for keeping temp files

This commit is contained in:
Moritz Bunkus 2009-02-28 19:17:17 +01:00
parent 0db67d7425
commit d3d5b880b6

View File

@ -22,6 +22,7 @@ class Test
end
def unlink_tmp_files
return if (ENV["KEEP_TMPFILES"] == "1")
n = "mkvtoolnix-auto-test-" + $$.to_s + "-"
Dir.entries("/tmp").each do |e|
File.unlink("/tmp/#{e}") if ((e =~ /^#{n}/) and
@ -74,7 +75,7 @@ class Test
def hash_tmp(erase = true)
output = hash_file(@tmp)
if (erase)
File.unlink(@tmp) if (File.exists?(@tmp))
File.unlink(@tmp) if (File.exists?(@tmp) && (ENV["KEEP_TMPFILES"] != "1"))
@debug_commands.push("rm #{@tmp}")
@tmp = nil
end