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 0b94656..7418506 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -63,6 +63,7 @@ To add a new test script: use Test::More; # Your test dependencies go here. + SKIP: { eval { require Test::Warnings; } or skip($@, 1); } eval { require 'ddclient'; } or BAIL_OUT($@); # Your tests go here. 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 095486f..42b1bb0 100644 --- a/t/version.pl.in +++ b/t/version.pl.in @@ -1,6 +1,7 @@ use Test::More; use version; +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");