diff options
author | Russ Allbery <eagle@eyrie.org> | 2016-01-17 12:38:45 -0800 |
---|---|---|
committer | Russ Allbery <eagle@eyrie.org> | 2016-01-17 12:38:45 -0800 |
commit | 57bcc0cb1e8893f6a39c4fcb902d02b920efde1a (patch) | |
tree | 88824fbc1b2d716c9f87470ad3b4d75444603831 /tests/perl | |
parent | 4feab8a987a345e38c44077d1042bf05ec03f0eb (diff) |
Adjust perl/module-version-t to run from tests
When run under runtests, it runs with a parent directory of tests,
and therefore needs to look for NEWS in ../NEWS. Allow for both
paths.
Diffstat (limited to 'tests/perl')
-rwxr-xr-x | tests/perl/module-version-t | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/perl/module-version-t b/tests/perl/module-version-t index a9ebf3b..47c22fe 100755 --- a/tests/perl/module-version-t +++ b/tests/perl/module-version-t @@ -37,8 +37,15 @@ use Test::RRA::ModuleVersion qw(test_module_versions update_module_versions); # List: The version number and the package name # Throws: Text exception if NEWS is not found or doesn't contain a version sub news_version { - my ($package, $version); - open(my $news, q{<}, 'NEWS') or die "$0: cannot open NEWS: $!\n"; + my ($package, $version, $news); + for my $path ('NEWS', '../NEWS') { + if (-f $path) { + open($news, q{<}, $path) or die "$0: cannot open $path: $!\n"; + } + } + if (!$news) { + die "$0: cannot find NEWS file\n"; + } SCAN: while (defined(my $line = <$news>)) { ## no critic (RegularExpressions::ProhibitEscapedMetacharacters) |