Boost logo

Boost-Build :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2004-10-20 07:37:52


On Wednesday 20 October 2004 15:04, Johan Nilsson wrote:

> > > That require that I replace 'exe' with 'unit-test'; is there a way of
> > > doing this in two separate steps, e.g.:
> > >
> > > exe my_exe ;
> > > run-unit-test my_exe ;
> >
> > I've just tried this:
> >
> > exe hello : hello.cpp ;
> > unit-test hello.ut : hello ;
>
> Works for me too, thanks.
>
> > You need a different name for unit-test target in this case. Otherwise,
> > V2 will consider both exe and unit-test to be different alternatives of
> > the same target. BTW, why do you need the above?
>
> Invoke the test driver several times with different command-line parameters
> (not absolutely necessary though).

Ah, in that case different name for each unit-test is a good thing.

> > >> > - Can I specify the output directory of the .exe (it depends on a
> > >> > couple of .dlls located in the bin directory)?
> > >>
> > >> No, at least now. You can use the "stage" rule in the meantime.
> > >
> > > That doesn't seem to play well with the unit-test rule referenced above
> > > (the tests are run at the original location, complaining about missing
> > > DLLs).
> >
> > That should not happen? Which V2 version do you use? In M10
> > (http://zigzag.lvk.cs.msu.su/~ghost/Milestone_10_preview/), which is due
> > soon, the 'unit-test' rule adds the proper DLL paths.
>
> I'm using the latest cvs version. Is there anyway to run the staged file
> using the cvs version, preserving tags etc?

None that I know, as unit-test is supposed to do that. A future version will
have "notfile" target which allows to run arbitrary actions, but:
- I'm not sure that will be convenient for running staged exes
- It's not implemented yet

> How can the unit-test rule know the proper DLL paths? I've got a couple of
> import libraries under deps/libs as well, with the corresponding DLLs under
> bin.

Good catch. On Linux, if exe (or unit-test) uses a shared lib file (including
prebuilt one), it will add the right paths. I've just realized that import
libs on windows do not work as nice.

However, you can try:

lib whatever : : <file>whatever.lib <file>whatever.dll ;

so that V2 knows there's DLL involved.

Or you can add <dll-path>deps/libs to your project requirements to make
unit-test add that path when running tests.

- Volodya

 


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk