Hi All, I'm not sure I have chosen the right testing architecture (external runner for a DSO), and I am having problems getting Boost::Test to run properly. I have print statements which are not printing in functions registered with BOOST_TEST_SUITE. And I have spiked a test would should print an error message. I thought it would be a good idea to look at [sample] projects that work rather than code snippets. Unfortunately, the link for "collection of examples" at [1] is broken. Does anyone know where to find Boost::Test samples? Thanks in advance, Jeff [1] http://www.boost.org/doc/libs/1_44_0/libs/test/doc/html/utf/intro.html
-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Jeffrey Walton Sent: Friday, August 05, 2011 11:05 AM To: boost-users@lists.boost.org Subject: [Boost-users] Boost::Test Samples?
Hi All,
I'm not sure I have chosen the right testing architecture (external runner for a DSO), and I am having problems getting Boost::Test to run properly. I have print statements which are not printing in functions registered with BOOST_TEST_SUITE. And I have spiked a test would should print an error message.
I thought it would be a good idea to look at [sample] projects that work rather than code snippets. Unfortunately, the link for "collection of examples" at [1] is broken.
Does anyone know where to find Boost::Test samples?
the examples themselves (but not the link to examples-toc) are at /1_47_0/libs/test/examples but you'll have to study them all to find the one that suit. When trying to output messages, I've fallen foul of this feature "BOOST_TEST_MESSAGE Important Messages generated by this tool do not appear in test log output with default value of the active log level threshold. For these messages to appear the active log level threshold has to be set to a value below or equal to "message". " which might be why your expected messages do not appear? HTH Paul --- Paul A. Bristow, Prizet Farmhouse, Kendal LA8 8AB UK +44 1539 561830 07714330204 pbristow@hetp.u-net.com
[Please do not mail me a copy of your followup]
boost-users@lists.boost.org spake the secret code
I thought it would be a good idea to look at [sample] projects that work rather than code snippets. Unfortunately, the link for "collection of examples" at [1] is broken.
Perhaps my 5-part tutorial on using boost.test will help. Part 1 is here: http://legalizeadulthood.wordpress.com/2009/07/04/c-unit-tests-with-boost-te... -- "The Direct3D Graphics Pipeline" -- DirectX 9 draft available for download http://legalizeadulthood.wordpress.com/the-direct3d-graphics-pipeline/ Legalize Adulthood! http://legalizeadulthood.wordpress.com
[Please do not mail me a copy of your followup]
boost-users@lists.boost.org spake the secret code
thusly: I thought it would be a good idea to look at [sample] projects that work rather than code snippets. Unfortunately, the link for "collection of examples" at [1] is broken.
Perhaps my 5-part tutorial on using boost.test will help. Part 1 is here: http://legalizeadulthood.wordpress.com/2009/07/04/c-unit-tests-with-boost-te... Thanks Richard. I came across that page when researching "Test setup error: test tree is empty" during knob turning. I think Part 1 is a great article, but its Win32 based and I'm working with a Linux
On Sat, Aug 6, 2011 at 12:48 PM, Richard
Jeffrey Walton
It would be incredibly helpful if the project offered a few real life sample of things such as a program (with a `main`), a static archive, and a DSO (or DLL). Nothing fancy - build a DSO via a makefile with two source files (A.cpp and B.cpp) and test them (A-test.cpp and B-test.cpp). In addition, a Visual Studio project to do the same would help the Win32 folks.
I am not quite sure what exactly you are looking here. If you looking for building instructions for standalone UTF library they are covered in documentation in general, but specifically will depend on make system you are using. I'd recommend though to start with included usage variant to eliminate any building/linking overhead.
I've heard a lot of great things about Boost, and I am glad it has worked for some folks. But after a couple of days on and off with Boost::Test, I'm beginning to wonder if its a good choice for our C++ project.
aside form build is there any other specific issues?
The Boost::Test library lacks clear and concise documentation (the online documentation is fractured, lack clarity, is hard to follow, and has broken links).
I'm sorry you do not like the way documentation is structured. What would you prefer it to look like? which particular parts you find unclear?
The library is clearly abusing macros in a C++ library
Can you show me an example of this abuse? And how would achieve the same result without using them?
(where are the predicates, functors, and other things I expect to see from a C++ library? Bjarne would probably chuckle or laugh).
I can't claim what Bjarne is doing or would do, but I did laugh when I read your statement above.
And the missing samples [broken links] are really not forgivable.
I did not look at docs for quite some time. It is indeed possible some links gone stale. I need to revive the toolchain we use to generate docs and I'll fix these. Gennadiy
Hello *,
below are my 5 cents regarding the docs and other points...
On Sun, Aug 7, 2011 at 8:41 AM, Gennadiy Rozental
Jeffrey Walton
writes: [...] I'm sorry you do not like the way documentation is structured. What would you prefer it to look like? which particular parts you find unclear?
The only point I can come up with, might be some shortcuts to recently used topics and these are: - Runtime configuration parameters - Testing tools. On the other hand I just did these 2 shortcuts in my browser.
The library is clearly abusing macros in a C++ library
Can you show me an example of this abuse? And how would achieve the same result without using them?
IMO there are none. And if the op dislikes macros he can really use the plain interface of the library which is also documented and supported ;)
(where are the predicates, functors, and other things I expect to see from a C++ library? Bjarne would probably chuckle or laugh).
I can't claim what Bjarne is doing or would do, but I did laugh when I read your statement above.
I can only support your statement, Gennadiy.
And the missing samples [broken links] are really not forgivable.
I did not look at docs for quite some time. It is indeed possible some links gone stale. I need to revive the toolchain we use to generate docs and I'll fix these.
I use the latest version and everything is documented well and all links I used to access were working fine.
Gennadiy
On Sun, Aug 7, 2011 at 6:37 AM, Ovanes Markarian
Hello *, below are my 5 cents regarding the docs and other points...
On Sun, Aug 7, 2011 at 8:41 AM, Gennadiy Rozental
wrote: Jeffrey Walton
writes: [...] I'm sorry you do not like the way documentation is structured. What would you prefer it to look like? which particular parts you find unclear?
The only point I can come up with, might be some shortcuts to recently used topics and these are: - Runtime configuration parameters - Testing tools. On the other hand I just did these 2 shortcuts in my browser.
The library is clearly abusing macros in a C++ library
Can you show me an example of this abuse? And how would achieve the same result without using them?
IMO there are none. And if the op dislikes macros he can really use the plain interface of the library which is also documented and supported ;)
(where are the predicates, functors, and other things I expect to see from a C++ library? Bjarne would probably chuckle or laugh).
I can't claim what Bjarne is doing or would do, but I did laugh when I read your statement above.
I can only support your statement, Gennadiy.
And the missing samples [broken links] are really not forgivable.
I did not look at docs for quite some time. It is indeed possible some links gone stale. I need to revive the toolchain we use to generate docs and I'll fix these.
I use the latest version and everything is documented well and all links I used to access were working fine. You guys are doing a great job. Pat yourselves on the back over a free beer.
Jeff
[Please do not mail me a copy of your followup]
Gennadiy Rozental
The Boost::Test library lacks clear and concise documentation (the online documentation is fractured, lack clarity, is hard to follow, and has broken links).
I'm sorry you do not like the way documentation is structured. What would you prefer it to look like? which particular parts you find unclear?
My complaint with the documentation is that when read linearly the semantic level of the information jumps up and down the complexity ladder repeatedly. By this, I mean that tiny implementation details are presented before the overall picture has been established. For a new user, this is troublesome because I get lost in expert details before I've even seen a complete novice overview of the framework. This is why I wrote that series of tutorials on how to write tests using Boost.Test. I'd be happy to work with you to turn this into a contribution to the documentation as a "getting started" or "user's guide" to boost.test. -- "The Direct3D Graphics Pipeline" -- DirectX 9 draft available for download http://legalizeadulthood.wordpress.com/the-direct3d-graphics-pipeline/ Legalize Adulthood! http://legalizeadulthood.wordpress.com
Richard
[Please do not mail me a copy of your followup]
Gennadiy Rozental
spake the secret code thusly: The Boost::Test library lacks clear and concise documentation (the online documentation is fractured, lack clarity, is hard to follow, and has broken links).
I'm sorry you do not like the way documentation is structured. What would you prefer it to look like? which particular parts you find unclear?
My complaint with the documentation is that when read linearly the semantic level of the information jumps up and down the complexity ladder repeatedly.
Indeed it's structured more by function than complexity, though some complexity order is present. For example it first covers simplest type of test cases going on to cover more advanced cases.
By this, I mean that tiny implementation details are presented before the overall picture has been established. For a
Can you give some examples?
new user, this is troublesome because I get lost in expert details before I've even seen a complete novice overview of the framework.
This is why I wrote that series of tutorials on how to write tests using Boost.Test. I'd be happy to work with you to turn this into a contribution to the documentation as a "getting started" or "user's guide" to boost.test.
As a first step plan to add a link to your tutorials somewhere in Boost.Test "getting started" section, but we can discuss actually incorporating it into Boost.Test docs. Regards, Gennadiy
[Please do not mail me a copy of your followup]
boost-users@lists.boost.org spake the secret code
Richard
writes: By this, I mean that tiny implementation details are presented before the overall picture has been established. For a
Can you give some examples?
Well, just look at the table of contents. Parts I and II start with the execution monitors. That shouldn't be first. It should be last. By putting it first it feels like its very important stuff that I need to know before anything else, but having used Boost.Test for several years now, I can't think of a single occasion where I needed to know these details. They could even be in an appendix. I remember having this feeling repeatedly as I read through the documentation linearly, but its been a few years since I read through it to cite more specific examples. However, it was my overall impression of the documentation. -- "The Direct3D Graphics Pipeline" -- DirectX 9 draft available for download http://legalizeadulthood.wordpress.com/the-direct3d-graphics-pipeline/ Legalize Adulthood! http://legalizeadulthood.wordpress.com
[Please do not mail me a copy of your followup]
boost-users@lists.boost.org spake the secret code
It would be incredibly helpful if the project offered a few real life sample of things such as a program (with a `main`), a static archive, and a DSO (or DLL).
This all boils down to understanding how things are packaged in C++, which isn't really the point of the blog post. The blog post was to teach you how to start writing unit tests with Boost.Test. My target audience is primarily Windows developers, so I wanted to demonstrate good setup practices for that audience.
I've heard a lot of great things about Boost, and I am glad it has worked for some folks. But after a couple of days on and off with Boost::Test, I'm beginning to wonder if its a good choice for our C++ project.
At a former employer, we spent quite a bit of time evaluating different unit testing frameworks for C++, including a homebrew unit test framework. Boost.Test is as featureful as the rest of them, is widely available and widely used.
The Boost::Test library lacks clear and concise documentation (the online documentation is fractured, lack clarity, is hard to follow, and has broken links).
I found the documentation difficult to use as a programming guide. It serves well as a reference for advanced users. I know from personal experience that if you are an advanced user of something, it is hard to write documentation for it that is accessible to new users. It can be done, but its hard.
The library is clearly abusing macros in a C++ library (where are the predicates, functors, and other things I expect to see from a C++ library?
I would say that it is using macros, not abusing them. There is a considerable amount of boiler plate in fixtures, assertions and so-on and that boiler plate is most readily provided by a macro. Do you really want to be typing __FILE__ and __LINE__ on every assertion? There isn't any alternative to macros to supply this automatically. -- "The Direct3D Graphics Pipeline" -- DirectX 9 draft available for download http://legalizeadulthood.wordpress.com/the-direct3d-graphics-pipeline/ Legalize Adulthood! http://legalizeadulthood.wordpress.com
participants (5)
-
Gennadiy Rozental
-
Jeffrey Walton
-
legalize+jeeves@mail.xmission.com
-
Ovanes Markarian
-
Paul A. Bristow