Boost logo

Boost :

From: Kåsa, Daniel Roy (Daniel.roy.Kaasa_at_[hidden])
Date: 2004-02-12 02:33:28


I have just downloaded the latest release of boost so that I could start using the Test Framework. I am part of a fairly large project working on complex software. My project feels as though the boost test framework is beginning to become more mature and we interested in applying it to our test procedures.
I have been working on a prototype test environment for my project using the test framework and I have come across some minor problems:

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) 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.

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?

Daniel R. Kåsa


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