[Portland] xdg-utils proof of concept

Kevin Krammer kevin.krammer at gmx.at
Sat Apr 29 17:15:12 EEST 2006

On Saturday 29 April 2006 00:46, Bryce Harrington wrote:
> On Mon, Apr 24, 2006 at 11:57:27PM +0200, Kevin Krammer wrote:
> > Anyway, I like the idea of a test target for the Makefile, especially
> > since we now have a fixed set of standard return values.
> Could you give a pointer to the page/email with the return values?
> That'd be a handy doc to have when making tests in the future.

They are handled by exit_* functions in xdg-utils-common.in

exit_success -> 0

exit_failure_arg_count: not enought or to many arguments, for example no 
arguments at all
 -> 1, prints usage

exit_failure_arg_malformed: when a script encounters an argument it does not 
expect, for example unknown command switch
 -> 2, prints usage

exit_failure_operation_impossible: when a recognized action can not be 
performed, for example when needed program is not available
 -> 3

exit_failure_operation_failed: for example when an utility program returns an 
error code
-> 4

Each script also knows a couple of shared commands (also part of the common 
script code file):
--help: prints usage and examples
--version: prints a version string, defined in xdg-utils-common.in

> > A little bit like unit testing for the scripts.
> I'm assuming that unit/functional testing is really all we need at this
> point, as opposed to performance or stress tests?

I think so. Its important to detect any problems that might be distribution or 
DE version specific etc.

> > I had a quick look at Bryce's original patch and it looks good. Not sure
> > if it can still be applied after all the recent changes, but if it can or
> > Bryce has enough time to update it, I'd say commit it!
> The only change I had to make was that apparently some files got moved
> around, so I just added the path to the scripts subdir.  Dunno if that's
> the most eligant solution but it's simple and should work correctly all
> the time.

We can always change it later on if someone has a problem with it. IMHO no 
need to worry about at the moment.


Kevin Krammer <kevin.krammer at gmx.at>
Qt/KDE Developer, Debian User
Moderator: www.mrunix.de (German), www.qtcentre.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/portland/attachments/20060429/1471d49f/attachment.pgp

More information about the Portland mailing list