Fixed use_ok bug for t/core_events.t. Made 00-load.t test for loading modules
Kartik Thakore [Mon, 9 Nov 2009 11:44:03 +0000 (06:44 -0500)]
Build.PL
t/00-load.t [new file with mode: 0644]
t/constantspm.t
t/core_events.t

index 7c1df59..0e5a3a5 100644 (file)
--- 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 (file)
index 0000000..3b49559
--- /dev/null
@@ -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;
+ }
index be516e1..0f06388 100644 (file)
@@ -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();
index 3754439..619c876 100644 (file)
@@ -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/);