[qmtest] command.ShellCommandTest run directory

Mark Mitchell mark at codesourcery.com
Mon Nov 10 17:39:16 UTC 2003


On Sun, 2003-11-09 at 00:58, Gilles Depeyrot wrote:
> Hi,
> 
> I would like to have command.ShellCommandTest tests in a QMTest 
> database that run shell scripts that are in the same directory as the 
> current test. Previous QMTest releases used to change the current 
> directory to the test directory itself which allowed commands to be 
> specified as "./someshell.sh". CVS of QMTest no longer seems to change 
> the current directory so that the command "./someshell.sh" is no longer 
> found.

The reason that QMTest no longer changes the directory is that it is not
safe to change the directory in a multi-threaded program.  In
particular, the directory change affects all of the threads, so if
QMTest were to change the directory for every test it would no longer be
able to run more than one test at once.

> What is the correct way to specify the directory of the current test in 
> the command field of command.ShellCommandTest tests?

I think that the best change would be to have QMTest include the test ID
and the database path in the shell-script context, i.e., as $QMV_*
variables.

Would that work for you?

-- 
Mark Mitchell <mark at codesourcery.com>
CodeSourcery, LLC




More information about the qmtest mailing list