471,319 Members | 1,579 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,319 software developers and data experts.

version 2.0 of C++ Unit Test Library released!

I released version 2.0 of C++ Unit Test Library. You can download
it from SourceForget.Net at http://sourceforge.net/projects/cppunittest/
..

I wrote this unit test library because other unit test frameworks
always lacked features I considered important. Some only provided
output in certain formats, and I had no easy way to choose my own
format. Most provided no protection against exceptions. Only a few
were useful for unit-testing at exit time. Several were useless if the
host program crashed during a test since they provided no output. Not
a good experience overall.

I wrote down what I considered essential features for a C++ unit test
library, and what considerations should influence the design.
Important Features and Design Considerations:
1. Configurable output options for output types provided by library.
Also allow host program to receive notices about test results so it
can send results to other output formats.
2. Handles exceptions that occur in unit tests - and even allow host
program to test functions where exceptions are expected for some
input.
3. Provides strong exception safety for all internal operations, and
protects itself from exceptions thrown within host program.
4. Has 3 levels of test severity (warning, checked, required). If a
required test fails, the program ends. If a warning fails, the failure
is logged, but the unit test still passes.
5. Can send output to stdout, stderr, text file, xml file, and html
files simultaneously.
6. Can send text messages directly into output.
7. Host program can group tests together.
8. Provides summary table of all tests.
9. Can exercise unit tests even as program exits.
10. Library should be easy to compile, easy to setup within a host
program, easy to add new tests, and easy to parse test results. New
users should be able to learn how to use library quickly.
11. Objects within library should never break class invariants. Also,
library should provide accurate output even when host program
crashes.
12. Source code should compile as cleanly as possible with at least 2
different compilers, and behave the same no matter which compiler is
used.
13. Library should have as tiny a memory footprint as possible.
14. Big-O complexity of each function should be as small as possible.
The unit-test library should not degrade runtime performance of host
program.
15. Library should allow for long-term tracking of test results. (It
does this by adding overall test result totals to a "main" html page
as well as to the html page for the current test results.)
16. Independent Library should not rely on other libraries, only
functions and classes mentioned in the C++ Standard.
Please let me know if you want other features in the library, or have
other design considerations which may improve the unit test library. I
would also appreciate feedback on the overall usability and usefulness
of the library.

Cheers,

Rich Sposato

Jul 18 '07 #1
1 1622
On Wed, 18 Jul 2007 11:23:26 -0700, rich_sposato wrote:
>I released version 2.0 of C++ Unit Test Library. You can download
it from SourceForget.Net at http://sourceforge.net/projects/cppunittest/
[...]
>Please let me know if you want other features in the library, or have
other design considerations which may improve the unit test library. I
would also appreciate feedback on the overall usability and usefulness
of the library.
Provide at least a minimal Project Web Site (at SourceForge) that
depicts the 'look and feel' of your library.
--
Roland Pibinger
"The best software is simple, elegant, and full of drama" - Grady Booch
Jul 19 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

19 posts views Thread by newbiecpp | last post: by
16 posts views Thread by Greg Roberts | last post: by
1 post views Thread by Viviana Vc | last post: by
5 posts views Thread by shuisheng | last post: by
1 post views Thread by Richard Lewis Haggard | last post: by
6 posts views Thread by Vyacheslav Maslov | last post: by
20 posts views Thread by earthwormgaz | last post: by
2 posts views Thread by =?Utf-8?B?c2lwcHl1Y29ubg==?= | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.