Executable paths and working directories
Nathaniel Smith
njs at uclink4.berkeley.edu
Fri Jan 3 11:51:34 UTC 2003
In our (envisioned) setup, we have tests written in C++ that get
compiled more-or-less alongside the source code they're testing, and a
test database for the whole project that has entries to call the
executables that do the real testing. What I'm wondering is how I
should be telling the qmtest Test objects where their executables are.
I could always hack something specific into my custom test class (by,
say, using some logic to find the root of the build tree, and
chdir()'ing there before running an executable specified by a relative
path), but it seems like there must be a better and more general
solution, and I'm wondering how it would work.
Thoughts:
-- from looking at the ItemDescriptor code, it appears that _all_
tests, resources, etc., can have associated working directories
that they are run in. However, there is no UI to set this
information, and in fact xml_database doesn't even store it --
rather, it just sets the working directory to be whatever
directory in the test database happens to contain the .qmt file
in question, which isn't very useful.
-- so adding such a UI and a way to store the working directory
could help some. We'd still have to decide what the working
directory was defined relative to -- the test db directory, I
suppose?
-- however, just adding a way to set the working directory on a
per-item basis prolly isn't enough, because you might want to
vary it between runs -- in my case, I need some way to specify
where the build directory is, and it could be anywhere. The
obvious way to do this is via a special entry in the context.
Perhaps we should have the working directory specified in the
database undergo python % expansion against the context?
-- I have no idea how all this would or should interact with
targets.
-- Nathaniel
--
.i dei jitfa fanmo xatra
This email may be read aloud.
More information about the qmtest
mailing list