"make test" target (was Re: [Portland] xdg-utils proof of concept)
bryce at osdl.org
Sat Apr 29 01:39:40 EEST 2006
On Mon, Apr 24, 2006 at 04:39:34PM -0500, Jeremy White wrote:
> > What do you think of this approach? The attached patch adds a 'make
> > test' target to the makefile system, and I stubbed out a couple simple
> > tests for two of the commands. If this approach looks ok, I can go
> > ahead and flesh these tests further and add tests for the other
> > commands. It's nothing fancy, but may be sufficient for just getting
> > some limited testing in place. I'm not sure about stuff that requires
> > user interaction, though, but imagine there are ways to automate even
> > that...
> > Anyway, if this patch looks ok I can commit it.
> Hey Bryce,
> I was toying with the idea of working up my new third party
> software - WinBig (TM) - entirely as an exercise in testing
> My thought was to have a process that was fairly heavy on user
> interaction, as that struck me as necessary. (e.g. Did the menu
> show up? Did the right app open blat.mime?)
> But then I recalled that you'd started down that road, and
> I didn't want to duplicate effort. I took a quick glance,
> and didn't see 'make test' in the current tip; have you had any further
> thoughts with this?
I've committed the changes to add a make test target to the xdg-utils
I made two tests - one for xdg-desktop, another for xdg-copy. Nothing
fancy; they just attempt to run the commands on test files and check the
error code. But it's a start.
The tmp files probably should have proper randomly generated tmp names
(e.g., use the pid or something). Also, in order to "find" the scripts,
I just append "../scripts" to $PATH; I don't know if that's the most
appropriate way to do it.
One issue I ran into while doing these, is that if I run make test from
a headless box (e.g., over ssh), I get the error "xprop: unable to open
display ''". However, during a normal run, the tests aren't popping up
GUI's, so I'm wondering if this is an unnecessary error?
Anyway, please give 'make test' a shot and let me know if anyone runs
into strange issues. If this looks like an ok approach to folks, I'll
expand the tests to cover the rest of the scripts, as I have time.
It would be great if when people add new functionality to a given
script, if they could also update it's test file to include test(s) for
More information about the Portland