From: Emil Dotchevski (emildotchevski_at_[hidden])
Date: 2006-04-19 14:58:23
Maybe because I'm running it under windows, I get errors which I think have
to do with the escape sequences already mentioned...
Please correct me if I'm wrong, but it seems to me there should be a simpler
way to accomplish this. The boost-build system already has a nice feature
for testing c/cpp files for compile errors:
compile foo.cpp : : compile-test-foo ;
Something along the following lines would be ideal:
compile-header foo.h : : header-test-foo ;
Perhaps we need an extra argument to the compile-header rule, to tell it
whether to treat the header as C++ or C. I suppose implementing this would
be easy, especially if the compiler has an option to tell it whether to
treat the input file as C++ or C. If not, then it would be necessary to
create a temporary .c/.cpp file which includes the header, and compile
that -- but even in that case, the cpp file should be treated as the .rsp
files, meaning that the user usually doesn't have to know about it.
It is probably even possible to not add a special compile-header rule, but
to modify the existing compile rule. In fact I tried to use it as-is with
one of my headers, but I get this error:
error: unable to construct ./test-info_int.h
To debug this problem, try the --debug-generators option.
I guess I should learn jam and code things like this myself instead of
posting lame feature requests :) but for now unfortunatelly I really don't
have the time...
----- Original Message -----
From: "João Abecasis" <jpabecasis_at_[hidden]>
To: "Boost Build" <boost-build_at_[hidden]>
Sent: Wednesday, April 19, 2006 6:21 AM
Subject: Re: [Boost-build] Compile tests for headers
Kevin Wheatley wrote:
> João Abecasis wrote:
>> What do others think about this? I'd like to hear your comments on the
>> approach and implementation, as well as bug reports ;-)
> In general I like the idea as a feature for my own use too.
> Bug? When you have 0 found headers in a directory though you get an
> error relating to the lack of tests...
> *** argument error
> * rule test-suite ( suite-name : tests + )
> * called with: ( repository.headers : )
> * missing argument tests
Aha! In this case, I'm not sure it is a bug. test-suite is part of
Boost.Build-testing and it provides a way of grouping together a set of
tests under a virtual target name. Hmmm... Then again, perhaps I should
provide my own virtual name for the headers tests as well. I'll look
Thanks for reporting!
In the meantime the workaround is to skip the test-suite and directly use,
import headers ;
headers dirs ;
> Not sure about the the weird escaped values for the test
> objects/executables/etc. looks odd.
> MkDir1 bin/directory%2finclude%2fsomeincludefile%2eh.test
Right. I also find these odd. The problem is I need to give each header
test a unique name. By default this would be the filename minus path and
file-extension which is prone to collisions. I sticked to this scheme
only because it is simple and reversible, although other escaping
mechanisms are possible. Another option would be to use a
non-descriptive sequential naming scheme:
, possibly outputting the corresponding header paths to a separate file.
I've tried both approaches locally.
Or maybe I can skip naming the tests... I'll look into this possibility,
which would be tied to the fix for the issue above.
Thanks for your comments!
Unsubscribe & other changes:
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