Boost logo

Boost-Build :

From: Joao Abecasis (jpabecasis_at_[hidden])
Date: 2005-08-29 20:00:27


Hi!

I'd like to know if it is possible to do pattern matching inside text
files using only bjam and Boost.Build v2. If this is possible, I'd
appreciate if someone could give me some pointers. (I may be missing
something pretty basic...)

For my purposes, I want to scan a set of files with a regular expression
to extract name/value pairs "hidden" within comments in source files.

I looked into the {c-,common-,}scanner class, but I still can't grasp
what is going on in there and so I'm not sure if the same mechanism can
be used here. As I understand it the scanner classes recursively scan
files for included files, to generate the dependency graph. In this
case, I want to scan every file in a given set with a regular expression
and extract all matches as name/value pairs. No dependency graph would
be generated in the process nor targets would be added.

For some more background information on what I'm actually trying to
accomplish, consider the file my_test.cpp:

// Test-Name: my_test
// Test-Suite: my_library.my_test_suite
// Test-Type: compile-fail
// Requirements: ... some BBv2 requirements ...
//
// Description: some description of the test...

int main()
{
test_some_code();
}

(or something of the like, that's the basic idea)

I'd like my Jamfile to go through a directory containing similarly
commented source files and scan all (.cpp) files for the type of test,
and name of tests and generate appropriate bjam statements to build the
test-suite. It could also generate a warning or error if a source did
not contain some minimal information, like the type of test.

I'm hoping something along this lines will simplify maintenance of test
cases on a BB-based test-suite (or complicate -- it always depends on
how you look at it).

I hope I didn't make this post too long or convoluted...

Thanks for your feedback,

João Abecasis

 


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