From a9ab5b066f6c98fe8265730415c7a6773798e810 Mon Sep 17 00:00:00 2001 From: Russ Allbery Date: Sun, 17 Jan 2016 18:51:36 -0800 Subject: Import new tests/perl/module-version-t from rra-c-util This fixes locating the NEWS file when building out of tree. --- tests/perl/module-version-t | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/tests/perl/module-version-t b/tests/perl/module-version-t index 47c22fe..f1ebf0f 100755 --- a/tests/perl/module-version-t +++ b/tests/perl/module-version-t @@ -69,6 +69,17 @@ sub news_version { return wantarray ? ($version, $package) : $version; } +# Parse command-line arguments. +my $update; +Getopt::Long::config('bundling', 'no_ignore_case'); +GetOptions('update|u' => \$update) or exit 1; + +# If we're not updating, set up for Automake testing. Otherwise, we assume +# we're running from the top of the source tree. +if (!$update) { + automake_setup(); +} + # Get the package name and version. my ($version, $package) = news_version(); @@ -79,14 +90,10 @@ my $root = ($package eq 'rra-c-util') ? 'tests/tap/perl' : 'perl/lib'; # Main routine. We run as either a test suite or as a script to update all of # the module versions, selecting based on whether we got the -u / --update # command-line option. -my $update; -Getopt::Long::config('bundling', 'no_ignore_case'); -GetOptions('update|u' => \$update) or exit 1; if ($update) { update_module_versions($root, $version); } else { skip_unless_automated('Module version tests'); - automake_setup(); test_module_versions($root, $version); } exit 0; -- cgit v1.2.3