]> sourceware.org Git - lvm2.git/blame - report-generators/unit_test.rb
dmsetup: allow --noflush with status/wait for thin
[lvm2.git] / report-generators / unit_test.rb
CommitLineData
64f95b40
AK
1# Copyright (C) 2010 Red Hat, Inc. All rights reserved.
2#
3# This copyrighted material is made available to anyone wishing to use,
4# modify, copy, or redistribute it subject to the terms and conditions
5# of the GNU General Public License v.2.
6#
7# You should have received a copy of the GNU General Public License
8# along with this program; if not, write to the Free Software Foundation,
9# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
10
1033d120
JT
11# Reads the schedule files given on the command line. Runs them and
12# generates the reports.
13
14require 'schedule_file'
15require 'pathname'
16require 'reports'
17require 'erb'
18require 'report_templates'
19
20include ReportTemplates
21
22schedules = ARGV.map do |f|
23 p = Pathname.new(f)
24 Schedule.read(p.dirname, p)
25end
26
27total_passed = 0
28total_failed = 0
29
30# We need to make sure the lvm shared libs are in the LD_LIBRARY_PATH
31ENV['LD_LIBRARY_PATH'] = `pwd`.strip + "/libdm:" + (ENV['LD_LIBRARY_PATH'] || '')
32
33schedules.each do |s|
34 s.run
35
36 s.schedules.each do |t|
37 if t.status.success?
38 total_passed += 1
39 else
40 total_failed += 1
41 end
42 end
43end
44
45def mangle(txt)
46 txt.gsub(/\s+/, '_')
47end
48
49generate_report(:unit_test, binding)
50
51# now we generate a detail report for each schedule
52schedules.each do |s|
53 s.schedules.each do |t|
54 generate_report(:unit_detail, binding, Pathname.new("reports/detail_#{mangle(t.desc)}.html"))
55 end
56end
This page took 0.043079 seconds and 5 git commands to generate.