diff options
author | Russ Allbery <eagle@eyrie.org> | 2016-01-17 18:51:36 -0800 |
---|---|---|
committer | Russ Allbery <eagle@eyrie.org> | 2016-01-17 18:51:36 -0800 |
commit | a9ab5b066f6c98fe8265730415c7a6773798e810 (patch) | |
tree | a02881639fcfb2e48040098e30cd546f80a99bc0 /tests/perl/module-version-t | |
parent | b39428f02c66430c1bcb497e345315ea29fde99b (diff) |
Import new tests/perl/module-version-t from rra-c-util
This fixes locating the NEWS file when building out of tree.
Diffstat (limited to 'tests/perl/module-version-t')
-rwxr-xr-x | tests/perl/module-version-t | 15 |
1 files 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; |