[Top][All Lists]

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

Re: [PATCH 2/2] testsuite,pickles: Re-write test for pickles using `unit

From: Jose E. Marchesi
Subject: Re: [PATCH 2/2] testsuite,pickles: Re-write test for pickles using `unittest.pk`
Date: Tue, 08 Dec 2020 10:59:38 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

> I don't know the best way to run unit tests. I need your help!

Ok, how to integrate this...

With your patch there are a set of scripts in poke.pickles, and any
other testsuite where we want to use the pktest infrastructure.

Basically, we need a Makefile.am there, with a TEST variable containing
the scripts to run, i.e.:

---- testsuite/poke.pickles/Makefile.am ----

TESTS = argp-test color-test id3v1-test ...


Now, there are two issues here:

1) The scripts should have a shebang pointing to the right poke to use.
   This can be done by having the sources of the scripts in FOO-test.in
   files, and having extra rules to substitute $(top_builddir) in them.
   Something similar is done in utils/Makefile.am.  It would look like

   TESTS = ... argp-test ...

   do_subst = sed -e 's,[@]top_builddir[@],$(top_builddir),g'

   argp-test: argp-test.in Makefile
              $(do_subst) < $(srcdir)/argp-test.in > argp-test
              chmod +x argp-test

   And, in argp-test.in we would have:

   #!@top_builddir@/poke/poke -L

   ... code ...

2) Automake by default assumes the scripts/programs in TESTS implement a
   single test each.  Therefor it just looks at the exit status of the
   programs/scripts, counting it as a single PASS or FAIL.

   We have several tests per script, so we need to use a protocol.
   Fortunately automake supports test protocols (like TAP).  See the
   "Using the TAP test protocol" in the Automake manual.

reply via email to

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