Hash :
a3a3a875
Author :
Thomas de Grivel
Date :
2023-04-12T17:53:17
require 'fileutils'
Dir["*.c"].each do |file|
file_tmp = file + ".tmp"
File.open(file_tmp, "w") do |out|
test_case_name = ""
File.foreach(file) do |line|
line.match(/^TEST_CASE\((.*)\)$/) do |m|
test_case_name = m[1]
end
out.write line
out.puts "TEST_CASE_END(#{test_case_name})" if line == "}\n" && test_case_name != ""
end
end
FileUtils.cp(file, file + "~")
FileUtils.mv(file_tmp, file)
end