Commit 57bcc0cb authored by Russ Allbery's avatar Russ Allbery
Browse files

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
parent 4feab8a9
......@@ -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";
while (defined(my $line = <$news>)) {
## no critic (RegularExpressions::ProhibitEscapedMetacharacters)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment