File: test.pl

package info (click to toggle)
libconvert-binary-c-perl 0.86-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 13,264 kB
  • sloc: ansic: 47,836; perl: 4,980; yacc: 2,143; makefile: 61
file content (45 lines) | stat: -rwxr-xr-x 1,097 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/perl -w
################################################################################
#
# Copyright (c) 2005-2024 Marcus Holland-Moritz. All rights reserved.
# This program is free software; you can redistribute it and/or modify
# it under the same terms as Perl itself.
#
################################################################################

BEGIN {
  $only_basic = $] < 5.005;

  if ($only_basic) {
    print STDERR <<ENDWARN;

--> WARNING: The version of perl you're using ($]) is very old.
-->
-->   The complete test suite cannot be run with perl < 5.005.
-->
-->   I will only run some very basic tests now.

ENDWARN
  }

  eval q{
    use Test::Harness;
    $Test::Harness::switches = "-w";
  };
}

@tests = @ARGV ? @ARGV : find_tests();
die "*** Can't find any test files\n" unless @tests;

$ENV{PERL_DL_NONLAZY} = 1;

runtests(@tests);

sub find_tests
{
  use File::Find;
  my $fd = $only_basic ? '1' : $ENV{ONLY_FAST_TESTS} ? '[0123478]' : '\d';
  my %t;
  find(sub { -f and /^$fd\d{2}_\w+\.t$/ and $t{$File::Find::name}++ }, 'tests');
  return sort keys %t;
}