File: core_multi.t

package info (click to toggle)
libsdl-perl 2.548-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,972 kB
  • sloc: perl: 13,985; ansic: 583; makefile: 35
file content (59 lines) | stat: -rw-r--r-- 950 bytes parent folder | download | duplicates (5)
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
56
57
58
59
#!/usr/bin/perl -w
use strict;
use warnings;
use SDL;
use Test::More;

plan( tests => 4 );

my @done = qw/ none /;

use_ok('SDL::MultiThread');
SKIP:
{
	skip 'Not implemented', 1;

	can_ok( 'SDL::MultiThread ', @done );
}

my @left = qw/
	create_thread
	thread_id
	get_thread_id
	wait_thread
	kill_thread
	create_mutex
	destroy_mutex
	mutex_P
	mutex_V
	create_semaphore
	destroy_semaphore
	sem_wait
	sem_try_wait
	sem_wait_timeout
	sem_post
	sem_value
	create_cond
	destroy_cond
	cond_signal
	cond_broadcast
	cond_wait
	cond_wait_timeout
	/;

my $why =
	  '[Percentage Completion] '
	. int( 100 * $#done / ( $#done + $#left ) )
	. "\% implementation. $#done / "
	. ( $#done + $#left );

TODO:
{
	local $TODO = $why;
	pass "\nThe following functions:\n" . join ",", @left;
}
if   ( $done[0] eq 'none' ) { print '0% done 0/' . $#left . "\n" }
else                        { print "$why\n" }

pass 'Are we still alive? Checking for segfaults';
sleep(2);