Boost logo

Boost-Build :

From: David Abrahams (david.abrahams_at_[hidden])
Date: 2002-04-04 10:19:39

----- Original Message -----
From: "Vladimir Prus" <ghost_at_[hidden]>
To: <jamboost_at_[hidden]>
Sent: Thursday, April 04, 2002 9:53 AM
Subject: Re: [jamboost] Test system

> David Abrahams wrote:
> > However, I would prefer this interface:
> >
> > class TestDirectory:
> > __init__(source_path = None):
> > """creates a temporary directory and, if
> > source_path is supplied, copies the directory tree rooted at
> > to the temporary directory"""
> >
> > close():
> >
> > """deletes the contents of the temp directory if not already
> > done"""
> > __del__():
> > """deletes the contents of the temp directory if not already
> > done"""
> >
> > path():
> > """returns the absolute path to the root of the scratch
> > directory"""
> >
> > expect_addition(file):
> > expect_removal(file):
> > ... # as described in your doc
> >
> > class Tester:
> >
> > def __init__
> > # does not create a scratch tree
> >
> > run_build_system(args, working_dir, ... )
> > """runs build system in working_dir..."""
> >
> > We would need something like this in order to support testing
> > ALL_LOCATE_TARGET (or whatever the equivalent will be). I realize
> > is a big change for you, so please use careful judgement about it.
If it
> > isn't obviously "more right" to you, please say so, and consider
> > rejecting my suggestion.
> I have not yet any final opinion, and surely won't have it till
> Some questions:
> 1. Do you mean that class TestDirectory will also contain the changes
made to
> this directory during last build system run?

As an implementation detail, but yes. There would certainly be a way to
ask what the unexpected changes are since its creation.

> 2. Do you mean that argument 'working_dir' to Tester.run_build_system
> be of type 'TestDirectory' and that argument will be modified to
> the changes made to the dir?

Actually, it was meant to just be a regular path. The TestDirectory
should have the means to do the comparison and generate the list of
changes (it can gather up a description of the original contents when it
is created).

> 3. I have a vague feeling that your design will leave class Tester
with no
> methods, except for __init__ and run_build_system. Have I missed

No, that's roughly about right. I'm not sure whether we need a
build-system-specific tester or not. I am pretty sure we need a way to
run tests that involve modifications to two independent trees. It might,
however, be possible to run these tests by arranging the initial
directory thus:


It should be possible to do everything we need with a system like that,
as long as the independent-tree-* can be presented to the build system
as absolute paths so it doesn't treat them as though they have a simple
relative-path relationship. However, we might need an optional argument
for methods like


It is much more important that we have a working test system really
quickly than that we have the perfect system eventually, so please think
hard about how to minimize the impact of all my dithering... ;-b



Boost-Build list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at