automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "make check" clean up


From: Luke Mewburn
Subject: Re: "make check" clean up
Date: Wed, 26 Nov 2014 11:23:26 +1100
User-agent: Mutt/1.5.20 (2009-12-10)

On Sun, Nov 23, 2014 at 03:06:16PM +0100, Thien-Thi Nguyen wrote:
  | Is there any way to specify an unconditionally executed
  | clean-up action for "make check"?
  | 
  | In Guile-PG, "make check" arranges to kick a daemon prior to
  | running the tests in the test wrapper script, and to kill it
  | afterwards via a ‘check-local’ Makefile.am target.  This works
  | fine when all the tests pass, but leaves the daemon up should
  | any of the tests fail.
  | 
  | For now, i've documented this in the README:
  | 
  |  http://git.savannah.gnu.org/cgit/guile-pg.git/tree/README?h=p#n109
  | 
  | but we all know how such hints are easily overlooked, and i'd
  | prefer a more robust solution that can DTRT noninteractively.

I work around this by having specific test groups to start the daemons
with AT_KEYWORDS([start]), and separate test groups I run at the end
with AT_KEYWORDS([stop]).

The tests for stopping the daemons don't fail if the daemon isn't
running; the exit 77 if the daemon isn't running to skip that stop group.

Even if test groups fail, the specific "stop" groups get executed.
If I've interrupted the "make check" mid-way, I can manually
terminate the daemons with:
        make check TESTSUITEFLAGS='-k stop'
(and start with TESTSUITEFLAGS="-k start", of course)

The TESTSUITEFLAGS is implememented as:
        check-local: atconfig atlocal $(TESTSUITE)
                $(SHELL) '$(TESTSUITE)' $(TESTSUITEFLAGS)


For simpler tests where I start the daemon just for a test group
I've used something like this pattern:

        AT_SETUP([foo])

        cleanup()
        {
                # do what's required to cleanup daemon if its running
        }

        AT_CHECK([start daemon])

        AT_CHECK([test 1], [0], [], [], [cleanup])

        AT_CHECK([test 2], [0], [], [], [cleanup])

        cleanup

        AT_CLEANUP()


Luke.

Attachment: pgpHMaxAP2FmZ.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]