public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] Tests for eclasses
@ 2005-05-10 20:54 Ciaran McCreesh
  2005-05-11  0:36 ` Ciaran McCreesh
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Ciaran McCreesh @ 2005-05-10 20:54 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 587 bytes --]

Is there a standard way of handling testing for utility-type eclasses?
For versionator I currently have a __versionator__test_blah function
included in the eclass (source versionator.eclass works, it doesn't have
any portage-specific code), but this is going to get a bit messy when I
add in another few dozen tests...

Maybe a simple test harness could be added as an option for the new
eclass / elib setup?

-- 
Ciaran McCreesh : Gentoo Developer (Vim, Shell tools, Fluxbox, Cron)
Mail            : ciaranm at gentoo.org
Web             : http://dev.gentoo.org/~ciaranm


[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-dev] Tests for eclasses
  2005-05-10 20:54 [gentoo-dev] Tests for eclasses Ciaran McCreesh
@ 2005-05-11  0:36 ` Ciaran McCreesh
  2005-05-11 10:39   ` Francesco Riosa
  2005-05-11  3:19 ` Brian Harring
  2005-05-14 11:21 ` Francesco Riosa
  2 siblings, 1 reply; 10+ messages in thread
From: Ciaran McCreesh @ 2005-05-11  0:36 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 802 bytes --]

On Tue, 10 May 2005 21:54:33 +0100 Ciaran McCreesh <ciaranm@gentoo.org>
wrote:
| Is there a standard way of handling testing for utility-type eclasses?
| For versionator I currently have a __versionator__test_blah function
| included in the eclass (source versionator.eclass works, it doesn't
| have any portage-specific code), but this is going to get a bit messy
| when I add in another few dozen tests...

And along the same lines... Please test the updated versionator.eclass
that I have posted to [1]. I'd really rather find any bugs *before* it
hits the tree :)

[1]: http://bugs.gentoo.org/show_bug.cgi?id=87157

-- 
Ciaran McCreesh : Gentoo Developer (Vim, Shell tools, Fluxbox, Cron)
Mail            : ciaranm at gentoo.org
Web             : http://dev.gentoo.org/~ciaranm


[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-dev] Tests for eclasses
  2005-05-10 20:54 [gentoo-dev] Tests for eclasses Ciaran McCreesh
  2005-05-11  0:36 ` Ciaran McCreesh
@ 2005-05-11  3:19 ` Brian Harring
  2005-05-11 15:46   ` Ciaran McCreesh
  2005-05-14 11:21 ` Francesco Riosa
  2 siblings, 1 reply; 10+ messages in thread
From: Brian Harring @ 2005-05-11  3:19 UTC (permalink / raw
  To: gentoo-dev

On Tue, May 10, 2005 at 09:54:33PM +0100, Ciaran McCreesh wrote:
> Is there a standard way of handling testing for utility-type eclasses?
> For versionator I currently have a __versionator__test_blah function
> included in the eclass (source versionator.eclass works, it doesn't have
> any portage-specific code), but this is going to get a bit messy when I
> add in another few dozen tests...
> 
> Maybe a simple test harness could be added as an option for the new
> eclass / elib setup?
Elaborate on the tests...
~brian
-- 
gentoo-dev@gentoo.org mailing list


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-dev] Tests for eclasses
  2005-05-11  0:36 ` Ciaran McCreesh
@ 2005-05-11 10:39   ` Francesco Riosa
  2005-05-11 12:12     ` Aaron Walker
  0 siblings, 1 reply; 10+ messages in thread
From: Francesco Riosa @ 2005-05-11 10:39 UTC (permalink / raw
  To: gentoo-dev

Ciaran McCreesh wrote:

>On Tue, 10 May 2005 21:54:33 +0100 Ciaran McCreesh <ciaranm@gentoo.org>
>wrote:
>| Is there a standard way of handling testing for utility-type eclasses?
>| For versionator I currently have a __versionator__test_blah function
>| included in the eclass (source versionator.eclass works, it doesn't
>| have any portage-specific code), but this is going to get a bit messy
>| when I add in another few dozen tests...
>
>And along the same lines... Please test the updated versionator.eclass
>that I have posted to [1]. I'd really rather find any bugs *before* it
>hits the tree :)
>
>[1]: http://bugs.gentoo.org/show_bug.cgi?id=87157
>
>  
>
Nice and 30% faster here . Not tested version_sort() but I've already
idea on where to use it.
-- 
gentoo-dev@gentoo.org mailing list


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-dev] Tests for eclasses
  2005-05-11 10:39   ` Francesco Riosa
@ 2005-05-11 12:12     ` Aaron Walker
  0 siblings, 0 replies; 10+ messages in thread
From: Aaron Walker @ 2005-05-11 12:12 UTC (permalink / raw
  To: gentoo-dev

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Francesco Riosa wrote:

> Not tested version_sort() but I've already
> idea on where to use it.

http://dev.gentoo.org/~ka0ttic/bash/vsort

Wrote that up last night in order to test version_sort on a whole bunch of
packages at once (vsort -r <regex>).  Requires >=app-portage/herdstat-1.1.0_rc2
(masked) though and assumes versionator.eclass is in $HOME.

I was just going to write that using eix would probably work, but apparently it
doesn't test the regular expression against the category/package in addition to
just the package.
- --
Is it weird in here, or is it just me?
		-- Steven Wright

Aaron Walker <ka0ttic@gentoo.org>
[ BSD | cron | forensics | shell-tools | commonbox | netmon | vim | web-apps ]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFCgfbGC3poscuANHARAhe4AKDEGHvWqRoxt3ii02MWwufvvxNZZACg4ziL
2A80y0Ex9OwzgQSYG3nyxxE=
=GTDX
-----END PGP SIGNATURE-----
-- 
gentoo-dev@gentoo.org mailing list


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-dev] Tests for eclasses
  2005-05-11  3:19 ` Brian Harring
@ 2005-05-11 15:46   ` Ciaran McCreesh
  2005-05-23  8:45     ` Francesco Riosa
  0 siblings, 1 reply; 10+ messages in thread
From: Ciaran McCreesh @ 2005-05-11 15:46 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 978 bytes --]

On Tue, 10 May 2005 22:19:27 -0500 Brian Harring <ferringb@gentoo.org>
wrote:
| On Tue, May 10, 2005 at 09:54:33PM +0100, Ciaran McCreesh wrote:
| > Is there a standard way of handling testing for utility-type
| > eclasses? For versionator I currently have a
| > __versionator__test_blah function included in the eclass (source
| > versionator.eclass works, it doesn't have any portage-specific
| > code), but this is going to get a bit messy when I add in another
| > few dozen tests...
| > 
| > Maybe a simple test harness could be added as an option for the new
| > eclass / elib setup?
| Elaborate on the tests...

Best example I can give are the kind of thing that's in versionator
already. The tests in the updated version in bug 87157 are probably
better than the ones in the tree...

-- 
Ciaran McCreesh : Gentoo Developer (Vim, Shell tools, Fluxbox, Cron)
Mail            : ciaranm at gentoo.org
Web             : http://dev.gentoo.org/~ciaranm


[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-dev] Tests for eclasses
  2005-05-10 20:54 [gentoo-dev] Tests for eclasses Ciaran McCreesh
  2005-05-11  0:36 ` Ciaran McCreesh
  2005-05-11  3:19 ` Brian Harring
@ 2005-05-14 11:21 ` Francesco Riosa
  2005-05-14 18:40   ` Ciaran McCreesh
  2 siblings, 1 reply; 10+ messages in thread
From: Francesco Riosa @ 2005-05-14 11:21 UTC (permalink / raw
  To: gentoo-dev

Ciaran McCreesh wrote:

>Is there a standard way of handling testing for utility-type eclasses?
>For versionator I currently have a __versionator__test_blah function
>included in the eclass (source versionator.eclass works, it doesn't have
>any portage-specific code), but this is going to get a bit messy when I
>add in another few dozen tests...
>
>Maybe a simple test harness could be added as an option for the new
>eclass / elib setup?
>
>  
>
ciaranm, would you commit it ?
-- 
gentoo-dev@gentoo.org mailing list


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-dev] Tests for eclasses
  2005-05-14 11:21 ` Francesco Riosa
@ 2005-05-14 18:40   ` Ciaran McCreesh
  0 siblings, 0 replies; 10+ messages in thread
From: Ciaran McCreesh @ 2005-05-14 18:40 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 423 bytes --]

On Sat, 14 May 2005 13:21:55 +0200 Francesco Riosa
<francesco@pnpitalia.it> wrote:
| ciaranm, would you commit it ?

Only if you comment on the bug with the results of the extensive testing
you've done to make sure that I haven't missed anything.

-- 
Ciaran McCreesh : Gentoo Developer (Vim, Shell tools, Fluxbox, Cron)
Mail            : ciaranm at gentoo.org
Web             : http://dev.gentoo.org/~ciaranm


[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-dev] Tests for eclasses
  2005-05-11 15:46   ` Ciaran McCreesh
@ 2005-05-23  8:45     ` Francesco Riosa
  2005-05-23  8:52       ` Ciaran McCreesh
  0 siblings, 1 reply; 10+ messages in thread
From: Francesco Riosa @ 2005-05-23  8:45 UTC (permalink / raw
  To: gentoo-dev

Ciaran McCreesh wrote:

>On Tue, 10 May 2005 22:19:27 -0500 Brian Harring <ferringb@gentoo.org>
>wrote:
>| On Tue, May 10, 2005 at 09:54:33PM +0100, Ciaran McCreesh wrote:
>| > Is there a standard way of handling testing for utility-type
>| > eclasses? For versionator I currently have a
>| > __versionator__test_blah function included in the eclass (source
>| > versionator.eclass works, it doesn't have any portage-specific
>| > code), but this is going to get a bit messy when I add in another
>| > few dozen tests...
>| > 
>| > Maybe a simple test harness could be added as an option for the new
>| > eclass / elib setup?
>| Elaborate on the tests...
>
>Best example I can give are the kind of thing that's in versionator
>already. The tests in the updated version in bug 87157 are probably
>better than the ones in the tree...
>
>  
>
A good example on how to do this is given with mysql sources, the file
hierarchy look like this:
/mysql-sources
\_ mysql-test
   \_ mysql-test-run.sh
   \_ t
   |  \_ test1.test
   |  \_ test2.test
   |  ...
   \_ r
      \_ test1.result
      \_ test2.result
      ...
When the programmer is satisfied from the output from one test he put
the result in r/test[n].result .
This way it can be diffed and make very easy see the result of every
little change.

Pros:
- Bash is an interpreted language, that must parse the sources files
every time, this approach has the benefit that tests related source is
keeped separate and so it doesn't waste bash parsing time.
- It make easier to create a script that run all the tests, making easy
to see the effects of one change to to other eclass

Cons:
- additional overhead on syncing portage tree


-- 
gentoo-dev@gentoo.org mailing list


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-dev] Tests for eclasses
  2005-05-23  8:45     ` Francesco Riosa
@ 2005-05-23  8:52       ` Ciaran McCreesh
  0 siblings, 0 replies; 10+ messages in thread
From: Ciaran McCreesh @ 2005-05-23  8:52 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 444 bytes --]

On Mon, 23 May 2005 10:45:24 +0200 Francesco Riosa
<francesco@pnpitalia.it> wrote:
| Cons:
| - additional overhead on syncing portage tree

Actually, with the new elib/eclass layout, this one's easy to avoid.
Just make a tests/ subdirectory and exclude it from sync.

-- 
Ciaran McCreesh : Gentoo Developer (Vim, Shell tools, Fluxbox, Cron)
Mail            : ciaranm at gentoo.org
Web             : http://dev.gentoo.org/~ciaranm


[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2005-05-23  8:53 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-10 20:54 [gentoo-dev] Tests for eclasses Ciaran McCreesh
2005-05-11  0:36 ` Ciaran McCreesh
2005-05-11 10:39   ` Francesco Riosa
2005-05-11 12:12     ` Aaron Walker
2005-05-11  3:19 ` Brian Harring
2005-05-11 15:46   ` Ciaran McCreesh
2005-05-23  8:45     ` Francesco Riosa
2005-05-23  8:52       ` Ciaran McCreesh
2005-05-14 11:21 ` Francesco Riosa
2005-05-14 18:40   ` Ciaran McCreesh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox