Boost logo

Boost :

From: Kåsa, Daniel Roy (Daniel.roy.Kaasa_at_[hidden])
Date: 2004-02-13 11:31:14


First of all thank you Gennadiy! I appreciate the speedy response and help.

> > 1. I need to have the test log and report written to two
> > separate files in xml format. (It would be nice to have a DTD
> > of both xml formats)
>
> Ok. Will do. Will the schema work?

Yes it would. You write 'the' schema does it exist? If so where?

I am concerned with this because I am trying to provide a well formed set of html reports based upon our regression tests. To do this I need the complete specification of the available tags and their respective attributes.
 
> > I did this by instructing the framework
> > with the command line argument: --output_format=XML. Now that
> > I had both the log and result report in XML format I needed
> > to create two file streams to redirect the output of them to
> > each their own file. This was easy to achieve with the log
> > using the set_log_stream method, but not so trivial with the
> > result report. Calling the singleton of the result report
> > before the test framework has initialized my code first calls
> > a null pointer crashing the test. How should this be done?
> > The documentation states that the interface of the
> > unit_test_result does not need to be used directly, but in my
> > case where I want a file stream instead of the std::err I
> > need to have access to the singleton and preferable in the
> > same place I set up the rest of my test suites.
>
> First of all why would you need to do anything? By default log goes to
> std::out and report goes to std::err. Also as you mentioned log output
> stream could be reset using set_log_stream method.

Very true, I was so busy trying to redirect the output that I didn't even notice this fact (Is this stated in the documentation?)

> This should be enough for your purposes As for report output stream it's
> actually unit_test_main who is responsible for setting specific stream and
> it not configurable at the moment.
>
> > 2. To achieve pt 1 I needed to edit unit_test_framework.hpp
> > (I think). I wanted to add support for my own command line
> > argument which would instruct the framework of the two files
> > I would like to create. So I thought it would be convenient
> > to use the reteive_framework_parameter method to retrieve my
> > custom command argument. Sadly enough I noticed that the
> > method doesn't return the value assigned to my argument
> > unless it is recognized. Is this fair?
>
> Yes. This is true. reteive_framework_parameter only strips parameters from > command line that it knows about. The
> rest you are getting in init function. You could use any method to
> retrieve the value needed for you.

I will have to, but I it would be convenient to have this as an available service. If it is ever meant that the framework could be customized I would expect support methods of this sort.

> Actually CLA support will be the first thing I am going to rework
> completely for next release. I think it should address your concern
> either. See mailing list for updates.

Nice to hear. :)

> > Daniel R. Kåsa
>
>
> Gennadiy.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk