From: Vincent Pit Date: Tue, 22 Sep 2009 18:09:07 +0000 (+0200) Subject: Only run the tests with fake valgrinds on linux X-Git-Tag: v1.10~1 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=245d45a8e57eb11cd4f4d67a86123419e5f75d37;p=perl%2Fmodules%2FTest-Valgrind.git Only run the tests with fake valgrinds on linux --- diff --git a/t/70-session.t b/t/70-session.t index 3bfa7d0..6bec989 100644 --- a/t/70-session.t +++ b/t/70-session.t @@ -31,33 +31,37 @@ if (\@ARGV == 1 && \$ARGV[0] eq '--version') { FAKE_VG } -my $vg_old = File::Temp->new(UNLINK => 1); -print $vg_old fake_vg('3.0.0'); -close $vg_old; -chmod 0755, $vg_old->filename; +SKIP: { + skip 'Only on linux' => 5 unless $^O eq 'linux'; -my $sess = eval { Test::Valgrind::Session->new( - valgrind => $vg_old->filename, - min_version => '3.1.0', -) }; -like $@, qr/^No appropriate valgrind executable/, 'old valgrind'; + my $vg_old = File::Temp->new(UNLINK => 1); + print $vg_old fake_vg('3.0.0'); + close $vg_old; + chmod 0755, $vg_old->filename; -my $vg_new = File::Temp->new(UNLINK => 1); -print $vg_new fake_vg('3.4.0'); -close $vg_new; -chmod 0755, $vg_new->filename; + my $sess = eval { Test::Valgrind::Session->new( + valgrind => $vg_old->filename, + min_version => '3.1.0', + ) }; + like $@, qr/^No appropriate valgrind executable/, 'old valgrind'; -$sess = eval { Test::Valgrind::Session->new( - valgrind => $vg_new->filename, - min_version => '3.1.0', -) }; -is $@, '', 'new valgrind'; -isa_ok $sess, 'Test::Valgrind::Session', 'new valgrind isa Test::Valgrind::Session'; + my $vg_new = File::Temp->new(UNLINK => 1); + print $vg_new fake_vg('3.4.0'); + close $vg_new; + chmod 0755, $vg_new->filename; -$sess = eval { Test::Valgrind::Session->new( - search_dirs => [ ], - valgrind => [ $vg_old->filename, $vg_new->filename ], - min_version => '3.1.0', -) }; -is $@, '', 'old and new valgrind'; -isa_ok $sess, 'Test::Valgrind::Session', 'old and new valgrind isa Test::Valgrind::Session'; + $sess = eval { Test::Valgrind::Session->new( + valgrind => $vg_new->filename, + min_version => '3.1.0', + ) }; + is $@, '', 'new valgrind'; + isa_ok $sess, 'Test::Valgrind::Session', 'new valgrind isa Test::Valgrind::Session'; + + $sess = eval { Test::Valgrind::Session->new( + search_dirs => [ ], + valgrind => [ $vg_old->filename, $vg_new->filename ], + min_version => '3.1.0', + ) }; + is $@, '', 'old and new valgrind'; + isa_ok $sess, 'Test::Valgrind::Session', 'old and new valgrind isa Test::Valgrind::Session'; +}