diff options
author | Joe Thornber <thornber@redhat.com> | 2010-07-20 14:38:44 +0000 |
---|---|---|
committer | Joe Thornber <thornber@redhat.com> | 2010-07-20 14:38:44 +0000 |
commit | 1033d120404c0e41ced5f36361e412ac03a3461f (patch) | |
tree | 8776b2d0770ad642176c9e079987e621251f1e23 /report-generators/title_page.rb | |
parent | 60f425d1b3508d71883ac1a4501f6ab7f3e32b08 (diff) | |
download | lvm2-1033d120404c0e41ced5f36361e412ac03a3461f.tar.gz lvm2-1033d120404c0e41ced5f36361e412ac03a3461f.tar.xz lvm2-1033d120404c0e41ced5f36361e412ac03a3461f.zip |
Report generators for unit tests and memory checks. Configure with
--enable-testing.
Diffstat (limited to 'report-generators/title_page.rb')
-rw-r--r-- | report-generators/title_page.rb | 32 |
1 files changed, 32 insertions, 0 deletions
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 + + |