From: Kartik Thakore Date: Mon, 9 Nov 2009 11:44:03 +0000 (-0500) Subject: Fixed use_ok bug for t/core_events.t. Made 00-load.t test for loading modules X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0697d1d6d0aab1bb0afd1630b1c1f78eb78a80b7;p=sdlgit%2FSDL_perl.git Fixed use_ok bug for t/core_events.t. Made 00-load.t test for loading modules --- diff --git a/Build.PL b/Build.PL index 7c1df59..0e5a3a5 100644 --- a/Build.PL +++ b/Build.PL @@ -350,6 +350,7 @@ my $build = SDL::Build->new( { 'Test::Simple' => '0.47', 'Test::Trap' => '0', + 'Test::Most' => '0.21', }, build_recommends => { diff --git a/t/00-load.t b/t/00-load.t new file mode 100644 index 0000000..3b49559 --- /dev/null +++ b/t/00-load.t @@ -0,0 +1,35 @@ + +use strict; +use warnings; + +use Test::Most 'bail'; + + + +BEGIN { + my @modules = + +qw / +SDL +SDL::Video +SDL::Events +SDL::Event +SDL::ActiveEvent +SDL::ExposeEvent +SDL::JoyAxisEvent +SDL::JoyBallEvent +SDL::JoyButtonEvent +SDL::JoyHatEvent +SDL::KeyboardEvent +SDL::keysym +SDL::MouseButtonEvent +SDL::MouseMotionEvent +SDL::QuitEvent +SDL::ResizeEvent +SDL::SysWMEvent +SDL::UserEvent +/; + plan tests => scalar @modules; + + use_ok $_ foreach @modules; + } diff --git a/t/constantspm.t b/t/constantspm.t index be516e1..0f06388 100644 --- a/t/constantspm.t +++ b/t/constantspm.t @@ -1,7 +1,7 @@ use strict; use warnings; use SDL::Events; -use Test::More tests => 1 + 624; # use_ok + constants +use Test::More; # use_ok + constants BEGIN { use_ok('SDL::Constants') } @@ -685,3 +685,4 @@ is( SDL_SAMPLEFLAG_ERROR(), 1 << 30, 'SDL_SAMPLEFLAG_ERROR() should also be ava is( SDL_SAMPLEFLAG_EAGAIN, 1 << 31, 'SDL_SAMPLEFLAG_EAGAIN should be imported' ); is( SDL_SAMPLEFLAG_EAGAIN(), 1 << 31, 'SDL_SAMPLEFLAG_EAGAIN() should also be available' ); +done_testing(); diff --git a/t/core_events.t b/t/core_events.t index 3754439..619c876 100644 --- a/t/core_events.t +++ b/t/core_events.t @@ -46,22 +46,24 @@ user syswm /; -use_ok( 'SDL::Events' ); -use_ok( 'SDL::Event' ); -use_ok( 'SDL::ActiveEvent' ); -use_ok( 'SDL::ExposeEvent' ); -use_ok( 'SDL::JoyAxisEvent' ); -use_ok( 'SDL::JoyBallEvent' ); -use_ok( 'SDL::JoyButtonEvent' ); -use_ok( 'SDL::JoyHatEvent' ); -use_ok( 'SDL::KeyboardEvent' ); -use_ok( 'SDL::keysym' ); -use_ok( 'SDL::MouseButtonEvent' ); -use_ok( 'SDL::MouseMotionEvent' ); -use_ok( 'SDL::QuitEvent' ); -use_ok( 'SDL::ResizeEvent' ); -use_ok( 'SDL::SysWMEvent' ); -use_ok( 'SDL::UserEvent' ); +use SDL::Events; +use SDL::Event; +use SDL::ActiveEvent; +use SDL::ExposeEvent; +use SDL::JoyAxisEvent; +use SDL::JoyBallEvent; +use SDL::JoyButtonEvent; +use SDL::JoyHatEvent; +use SDL::KeyboardEvent; +use SDL::keysym; +use SDL::MouseButtonEvent; +use SDL::MouseMotionEvent; +use SDL::QuitEvent; +use SDL::ResizeEvent; +use SDL::SysWMEvent; +use SDL::UserEvent; + + can_ok( 'SDL::Events', @done); can_ok( 'SDL::Event', @done_event); can_ok( 'SDL::ActiveEvent', qw/type gain state/);