File Coverage

buildlib/Clownfish/CFC/Test/TestUtils.pm
Criterion Covered Total %
statement 16 17 94.1
branch 1 2 50.0
condition n/a
subroutine 5 5 100.0
pod 0 1 0.0
total 22 25 88.0


line stmt bran cond sub pod time code
1             # Licensed to the Apache Software Foundation (ASF) under one or more
2             # contributor license agreements. See the NOTICE file distributed with
3             # this work for additional information regarding copyright ownership.
4             # The ASF licenses this file to You under the Apache License, Version 2.0
5             # (the "License"); you may not use this file except in compliance with
6             # the License. You may obtain a copy of the License at
7             #
8             # http://www.apache.org/licenses/LICENSE-2.0
9             #
10             # Unless required by applicable law or agreed to in writing, software
11             # distributed under the License is distributed on an "AS IS" BASIS,
12             # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13             # See the License for the specific language governing permissions and
14             # limitations under the License.
15              
16 4     4   3663 use strict;
  4         5  
  4         136  
17 4     4   16 use warnings;
  4         4  
  4         264  
18              
19             package Clownfish::CFC::Test::TestUtils;
20              
21             our $VERSION = '0.006000005';
22             $VERSION = eval $VERSION;
23              
24 4     4   17 use Exporter 'import';
  4         5  
  4         232  
25             our @EXPORT_OK = qw( test_files_dir );
26              
27 4     4   2112 use File::Spec::Functions qw( catdir updir );
  4         3544  
  4         712  
28              
29             sub test_files_dir {
30 4     4 0 57 my @dirs = (
31             't',
32             catdir( updir(), 'common', 'test' ),
33             );
34              
35 4         13 for my $dir (@dirs) {
36 4         17 my $cfbase = catdir( $dir, 'cfbase' );
37 4 50       5161 return $dir if -d $cfbase;
38             }
39              
40 0           die("test files dir not found");
41             }
42              
43             1;
44