From 1033d120404c0e41ced5f36361e412ac03a3461f Mon Sep 17 00:00:00 2001 From: Joe Thornber Date: Tue, 20 Jul 2010 14:38:44 +0000 Subject: Report generators for unit tests and memory checks. Configure with --enable-testing. --- report-generators/title_page.rb | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 report-generators/title_page.rb (limited to 'report-generators/title_page.rb') diff --git a/report-generators/title_page.rb b/report-generators/title_page.rb new file mode 100644 index 00000000..f6873eb1 --- /dev/null +++ b/report-generators/title_page.rb @@ -0,0 +1,32 @@ +# This generates the index for the reports, including generation +# times. + +require 'log' +require 'string-store' +require 'reports' +require 'erb' +require 'report_templates' + +include Reports + +reports = ReportRegister.new + +def safe_mtime(r) + r.path.file? ? r.path.mtime.to_s : "not generated" +end + +template_store = TemplateStringStore.new + +# FIXME: use generate_report() method +erb = ERB.new(template_store.lookup("index.rhtml")) +body = erb.result(binding) +title = "Generation times" + +erb = ERB.new(template_store.lookup("boiler_plate.rhtml")) +txt = erb.result(binding) + +Pathname.new("reports/index.html").open("w") do |f| + f.puts txt +end + + -- cgit