]> The Tcpdump Group git mirrors - libpcap/blob - testprogs/TESTst.pm
TESTrun: Accommodate older Perl versions.
[libpcap] / testprogs / TESTst.pm
1 require 5.8.4; # Solaris 10
2 use strict;
3 use warnings FATAL => qw(uninitialized);
4
5 # TESTrun helper functions (single-threaded implementation).
6
7 my @tests;
8
9 sub my_tmp_id {
10 return 'main';
11 }
12
13 sub set_njobs {
14 print "INFO: This Perl does not support threads.\n";
15 my $njobs = shift;
16 die "ERROR: Impossible to run $njobs tester threads!" if $njobs > 1;
17 }
18
19 sub start_tests {
20 @tests = @_;
21 }
22
23 # Here ordering of the results is obviously the same as ordering of the tests.
24 sub get_next_result {
25 my $test = shift @tests;
26 return undef unless defined $test;
27 my $result = $test->{func} ($test);
28 $result->{label} = $test->{label};
29 return $result;
30 }
31
32 1;