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   2593 use strict;
  4         6  
  4         117  
17 4     4   15 use warnings;
  4         4  
  4         213  
18              
19             package Clownfish::CFC::Test::TestUtils;
20              
21             our $VERSION = '0.006001';
22             $VERSION = eval $VERSION;
23              
24 4     4   14 use Exporter 'import';
  4         4  
  4         173  
25             our @EXPORT_OK = qw( test_files_dir );
26              
27 4     4   1818 use File::Spec::Functions qw( catdir updir );
  4         2767  
  4         562  
28              
29             sub test_files_dir {
30 4     4 0 45 my @dirs = (
31             't',
32             catdir( updir(), 'common', 'test' ),
33             );
34              
35 4         13 for my $dir (@dirs) {
36 4         18 my $cfbase = catdir( $dir, 'cfbase' );
37 4 50       5067 return $dir if -d $cfbase;
38             }
39              
40 0           die("test files dir not found");
41             }
42              
43             1;
44