PageRenderTime 23ms CodeModel.GetById 13ms app.highlight 7ms RepoModel.GetById 1ms app.codeStats 0ms

/t/core_multi.t

http://github.com/PerlGameDev/SDL
Perl | 59 lines | 50 code | 8 blank | 1 comment | 2 complexity | 82ddb926895adb874dae58ff002ddb53 MD5 | raw file
 1#!/usr/bin/perl -w
 2use strict;
 3use warnings;
 4use SDL;
 5use Test::More;
 6
 7plan( tests => 4 );
 8
 9my @done = qw/ none /;
10
11use_ok('SDL::MultiThread');
12SKIP:
13{
14	skip 'Not implemented', 1;
15
16	can_ok( 'SDL::MultiThread ', @done );
17}
18
19my @left = qw/
20	create_thread
21	thread_id
22	get_thread_id
23	wait_thread
24	kill_thread
25	create_mutex
26	destroy_mutex
27	mutex_P
28	mutex_V
29	create_semaphore
30	destroy_semaphore
31	sem_wait
32	sem_try_wait
33	sem_wait_timeout
34	sem_post
35	sem_value
36	create_cond
37	destroy_cond
38	cond_signal
39	cond_broadcast
40	cond_wait
41	cond_wait_timeout
42	/;
43
44my $why =
45	  '[Percentage Completion] '
46	. int( 100 * $#done / ( $#done + $#left ) )
47	. "\% implementation. $#done / "
48	. ( $#done + $#left );
49
50TODO:
51{
52	local $TODO = $why;
53	pass "\nThe following functions:\n" . join ",", @left;
54}
55if   ( $done[0] eq 'none' ) { print '0% done 0/' . $#left . "\n" }
56else                        { print "$why\n" }
57
58pass 'Are we still alive? Checking for segfaults';
59sleep(2);