diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 952f34b..143a712 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,6 +12,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + - name: install test dependencies + run: sudo apt-get install libtest-warnings-perl - name: autogen run: ./autogen - name: configure @@ -24,6 +26,8 @@ jobs: runs-on: ubuntu-16.04 steps: - uses: actions/checkout@v2 + - name: install test dependencies + run: sudo apt-get install libtest-warnings-perl - name: autogen run: ./autogen - name: configure diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 569863d..7418506 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -61,7 +61,10 @@ To add a new test script: ```perl use Test::More; - eval { require 'ddclient'; ddclient->import(); 1; } or die($@); + # Your test dependencies go here. + + SKIP: { eval { require Test::Warnings; } or skip($@, 1); } + eval { require 'ddclient'; } or BAIL_OUT($@); # Your tests go here. @@ -81,7 +84,7 @@ To add a new test script: module is not available. For example: ```perl - eval { require Foo::Bar; Foo::Bar->import(); 1 } or plan(skip_all => $@); + eval { require Foo::Bar; } or plan(skip_all => $@); ``` ## Compatibility diff --git a/configure.ac b/configure.ac index b979141..30e8019 100644 --- a/configure.ac +++ b/configure.ac @@ -27,8 +27,10 @@ m4_foreach_w([_m], [ ], [AX_PROG_PERL_MODULES([_m], [], [AC_MSG_ERROR([missing required Perl module _m])])]) -# Perl modules required for tests. Only prints a warning. +# Perl modules required for tests. Only prints a warning if not +# installed. m4_foreach_w([_m], [ + Test::Warnings ], [AX_PROG_PERL_MODULES([_m], [], [AC_MSG_WARN([some tests may be skipped due to missing module _m])])]) diff --git a/t/version.pl.in b/t/version.pl.in index e3ad892..42b1bb0 100644 --- a/t/version.pl.in +++ b/t/version.pl.in @@ -1,7 +1,8 @@ use Test::More; use version; -eval { require 'ddclient'; ddclient->import(); 1; } or die($@); +SKIP: { eval { require Test::Warnings; } or skip($@, 1); } +eval { require 'ddclient'; } or BAIL_OUT($@); is(ddclient->VERSION(), version->parse('v@PACKAGE_VERSION@'), "version matches Autoconf config");