- Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathcore_joystick.t
55 lines (45 loc) · 856 Bytes
/
core_joystick.t
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/usr/bin/perl -w
use strict;
use warnings;
use SDL;
use Test::More;
use SDL::Joystick;
my@done = qw/num_joysticks/;
can_ok( "SDL::Joystick", @done );
SDL::init(SDL_INIT_JOYSTICK);
is( SDL::Joystick::num_joysticks() >= 0, 1, "[num_joysticks] ran" );
SKIP:
{
skip "Need a joystick for below tests", 1
unless ( SDL::Joystick::num_joysticks() > 0 );
my$joy = SDL::Joystick->new(0);
pass "[new] can open joystick";
}
my@left = qw/
name
opened
index
num_axes
num_balls
num_hats
num_buttons
update
get_axis
get_hat
get_button
get_ball
/;
my$why =
'[Percentage Completion] '
. int( 100 * ( $#done + 1 ) / ( $#done + $#left + 2 ) )
. "\% implementation. "
. ( $#done + 1 ) . " / "
. ( $#done + $#left + 2 );
TODO:
{
local$TODO = $why;
fail "Not Implmented $_"foreach (@left)
}
print"$why\n";
done_testing();
sleep(2);