[pacman-dev] A makepkg test suite

Pierre Schmitz pierre at archlinux.de
Fri Jul 12 16:08:32 EDT 2013


Am 12.07.2013 21:56, schrieb Dave Reisner:
> On Fri, Jul 12, 2013 at 08:00:37PM +0100, Ashley Whetter wrote:
>> ...
>> Any suggestions or ideas?
>> Ashley
>>
> 
> Incoming wall of text and can of worms. I could have gone on, but I feel
> strongly about this because I've been down this road before and it's a
> shitfest.
> 
> ...

I once did write a test suite for dbscripts which is also entirely
written in Bash. And I have to agree with Dave here, the it's probably
easier to use Bash for your tests as well. Otherwise you might spend
more time on writing a Bash parser and test that instead of makepkg.

Here is what I did back then:
https://projects.archlinux.org/dbscripts.git/tree/test This is based on
shunit2. The actual tests are in test.d; lib/common.inc might also be
interesting. It sure has issues, but it was better than nothing and
helped a lot in development.

I spend a good portion of the time in writing setup and teardown
function which set up a clean working environment. This should be as
self-contained as possible and not rely on external ressources. This
will get interesting if you are testing vcs support, gpg and other funny
things.

But maybe start with very simple PKGBUILD files and check if they result
in valid packages. 

Greetings,

Pierre

-- 
Pierre Schmitz, https://pierre-schmitz.com


More information about the pacman-dev mailing list