diff options
author | Romain d'Alverny <rda@mageia.org> | 2011-12-12 22:46:41 +0000 |
---|---|---|
committer | Romain d'Alverny <rda@mageia.org> | 2011-12-12 22:46:41 +0000 |
commit | de97b7594050ca17fc6a9f40741286bc0ebd5fc3 (patch) | |
tree | c68d346730b238feae51be529b308ba6699ff632 | |
parent | 543061d149e356be0fc8b3fbaf524e80e8abe70e (diff) | |
download | isocheck-de97b7594050ca17fc6a9f40741286bc0ebd5fc3.tar isocheck-de97b7594050ca17fc6a9f40741286bc0ebd5fc3.tar.gz isocheck-de97b7594050ca17fc6a9f40741286bc0ebd5fc3.tar.bz2 isocheck-de97b7594050ca17fc6a9f40741286bc0ebd5fc3.tar.xz isocheck-de97b7594050ca17fc6a9f40741286bc0ebd5fc3.zip |
reorganize mounted images tests and summary output
-rw-r--r-- | test_iso.pl | 46 |
1 files changed, 26 insertions, 20 deletions
diff --git a/test_iso.pl b/test_iso.pl index bd3e03d..3a5e424 100644 --- a/test_iso.pl +++ b/test_iso.pl @@ -20,10 +20,10 @@ # Boston, MA 02110-1301, USA. # - use 5.010; use MDK::Common; use TAP::Harness; +use TAP::Parser::Aggregator; use Tools; my ($image_path) = @ARGV; @@ -51,30 +51,36 @@ print "# Date: ", `date --rfc-3339='ns' -u`; print "# Testing: $image_path\n"; print "# Host: ", `uname -n`; -$harness->runtests(glob_('t/*.t')); - -# Mounting the ISO -print "# Mounting ISO in /media/iso_check"; --r "/media/iso_check" or mkdir('/media/iso_check'); -system "mount -r " . if_(!-b $image_path, "-o loop ") . "$image_path /media/iso_check/"; -print "... ok\n"; +my $aggregator = TAP::Parser::Aggregator->new; +$aggregator->start; +$harness->aggregate_tests($aggregator, glob_('t/*.t')); -my $name = basename($image_path); -my %info = Tools::parse_mageia_iso_name($name); +my $name = basename($image_path); +my %info = Tools::parse_mageia_iso_name($name); +my @testfiles; -if ($info{variant} =~ m/^LiveCD/) { - # TODO: LiveCD specific tests +if ($info{variant} =~ /^LiveCD/) { + @testfiles = glob_('t_live_iso/*.t'); } else { - $harness->runtests(glob_('t_install_iso/*.t')); + @testfiles = glob_('t_install_iso/*.t'); } -# Umounting the ISO -print "# Umounting ISO\n"; -# FIXME this fails sometimes (with LiveCDs); no idea why. Force umount? -system 'umount /media/iso_check'; -system 'rm -r /media/iso_check'; -print "... ok\n"; -print "# Date: ", `date --rfc-3339='ns' -u`; +if (@testfiles) { + print "# Mounting ISO in /media/iso_check\n"; + -r "/media/iso_check" or mkdir('/media/iso_check'); + system "mount -r " . if_(!-b $image_path, "-o loop ") . "$image_path /media/iso_check/"; + + $harness->aggregate_tests($aggregator, @testfiles); + + print "# Umounting ISO\n"; + system 'umount -l /media/iso_check'; + rmdir('/media/iso_check'); +} + +$aggregator->stop; +$harness->summary($aggregator); my $tdiff = time() - $ts0; print "# Tested $name in $tdiff seconds.\n"; + +print $aggregator->all_passed, "\n", $aggregator->get_status, "\n";
\ No newline at end of file |