Boost logo

Boost Testing :

Subject: Re: [Boost-testing] [test] Re: Develop branch test runners crashing
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2015-06-23 19:03:26


AMDG

On 06/23/2015 12:41 PM, Gennadiy Rozental wrote:
> Rene Rivera <grafikrobot <at> gmail.com> writes:
>
> Hmmm... This works for me:
>
> rule docs-example-as-test ( test-file )
> {
> test-name-rule = [ MATCH \\.\\./doc/examples/(.*)\\.(.*)\\.cpp : $(test-
> file) ] ;
>
> return [ boost.test-self-test $(test-name-rule[2]) : ../doc/examples :
> doc_$(test-name-rule[1]) : included : : $(test-file) ] ;
> }
>
>
> test-suite "docs-examples-ts"
> :
> [ sequence.transform docs-example-as-test : [ glob ../doc/examples/*.cpp ]
> ]
> ;
>
> Obviously MATCH does not work correctly, since test-file path looks
> differently. How do I make it more robust?
>

The reason that MATCH doesn't work is that
the paths returned from glob are relative
to the working directory, not the directory
containing the jamfile. When b2 is run from
status/ this results in paths like
../libs/test/doc/example/*.cpp, which don't
match the pattern you gave. I would suggest
using path.basename to get the name of
the file without the directory component.

In Christ,
Steven Watanabe


Boost-testing list run by mbergal at meta-comm.com