[devscripts] 01/01: move test clean up to test rule

James McCoy jamessan at debian.org
Sat Dec 5 17:27:16 UTC 2015


On Sat, Dec 05, 2015 at 02:12:38PM +0000, Nicholas Bamber wrote:
> James,
> 	I can move it back of course.
> 
> 	I am actually puzzled why more is not done in debian/rules.

Like most packages, debian/ should only contain content that's relevant
for packaging.

Properly cleaning up detritus created by a test isn't specific to
packaging, so it should be handled by the test (e.g., using shunit's
oneTimeTearDown) or possibly by a clean target in test/Makefile.

> The whole
> devscripts structure seems sort of odd to me.

Why?  Debian-specific stuff should be handled by things in debian/.
"Upstream" stuff should be handled outside of debian/.

> 	I put the test clean up in debian/rules because then one can easily inspect
> the generated files between the test phase and the clean phase. More
> generally I can think of several places such clean up could be put in:
> 1. debian/rules
> 2. Makefile
> 3. test/Makefile
> 4. test/test_*
> 
> The two obvious places would seem to me 1. and 4. 4. seems not to be
> working.

Looking at test_package_lifecycle, it seems like use of either
oneTimeSetUp/oneTimeTearDown or setUp/tearDown would help.

> I am not quite sure why though I suspect the test script may be
> exiting earlier than the cleanup. However 1. looks better to me anyway for
> the reason I said. Both 2. and 3. look wrong to me. Why should test/Makefile
> know about the inner workings of the tests?

Why shouldn't it?  Do you expect other upstream Makefiles not to know
how to clean up their generated files?  The use of “debian/rules clean”
should typically only need to clean up files generated by the packaging,
not by the upstream build process.  The upstream files should be cleaned
by the upstream code.

> BTW there are several quetsions I have asked which have not been answered.

If they're buried in email chains about commits, where I wasn't already
part of the thread, that's probably why.  Start new threads when you're
discussing new topics.

> Also what are the plans for upload?

In the next week or so, probably.

Cheers,
-- 
James
GPG Key: 4096R/331BA3DB 2011-12-05 James McCoy <jamessan at debian.org>



More information about the devscripts-devel mailing list