File Coverage

cv.pm
Criterion Covered Total %
statement 28 31 90.3
total 28 31 90.3


line stmt code
1   # Copyright 2009-2013 Bernhard M. Wiedemann
2   # Copyright 2012-2020 SUSE LLC
3   # SPDX-License-Identifier: GPL-2.0-or-later
4    
5   # wrapper around tinycv
6    
7   use Mojo::Base -strict, -signatures;
8 76 use constant BPP => 3;
  76  
  76  
9 76 use ExtUtils::testlib;
  76  
  76  
10 76  
  76  
  76  
11   use File::Basename;
12 76 use Cwd qw(realpath);
  76  
  76  
13 76  
  76  
  76  
14   use Config;
15 20 my $vendorlib = $Config{installvendorlib};
  20  
16 76 my $libdir = realpath(dirname(__FILE__));
  76  
  76  
17 20 # undef is substituted at install time, see CMakeLists.txt
18 20 my $sysdir = undef;
19   return if ($sysdir && $libdir eq $sysdir);
20 20 my @s = stat("$libdir/ppmclibs/blib/lib/tinycv.pm");
21 20 unless (@s && -e "$libdir/ppmclibs/tinycv.pm" && $s[7] == (stat(_))[7]) {
22 20 $| = 1;
23 20 print STDERR "### Please build the tinycv bindings first (see os-autoinst's README)\n";
24 0 die("tinycv outdated");
25 0 }
26 0  
27   unshift(@INC, "$libdir/ppmclibs/blib/arch");
28   unshift(@INC, "$libdir/ppmclibs/blib/lib");
29 20 }
30 20  
31   1;