473,738 Members | 8,397 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Ne t 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 1800
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.Ne t 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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

19
2441
by: newbiecpp | last post by:
I am looking for a C++ unit testing program. I googled and found there are quite a few there, such as CppTest, C++Test, and DejaGnu. Can someone give me a recommendation among these programs? I want to the software is easy to use and has a nice interface. Please excuse me if it is out of the topic. Thanks in advance!
16
2570
by: Greg Roberts | last post by:
Hi I want to place the tests needed in the code using attributes. There seems to be enough code snippets around for me to cover this. e.g. // Test cases, run these here on the function and check the result
3
3695
by: | last post by:
I am working on a web/webservice application that has a service layer. Most service methods will perform an access-check before executing. This check uses the IPrincipal credentials available in HttpContext.Current. This works great. My issue is that I need to write unit tests for those service methods. These tests then run outside of IIS, thus there is no HttpContext.Current available - and the servicemethod will not execute. The two...
1
1626
by: Viviana Vc | last post by:
Hi all, I have "Visual Studio Team Suite" subscription and now I started to play with Visual Studio 2005 for creating Test Projects. The thing I am interested in is the "unit test". I tried out the steps from: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnvs05/html/VSTSUnitTesting.asp and everything seems to be fine. But this sample shows creating tests for methods/classes that you got by creating a C# project...
5
6527
by: shuisheng | last post by:
Dear All, I was told that unit test is a powerful tool for progamming. If I am writing a GUI code, is it possible to still using unit test? I have a little experience in using unittest++. But I can not work out a way to use it to test GUI code. Thanks a lot!
1
3444
by: Richard Lewis Haggard | last post by:
We're using VS05 and today the units tests have stopped working in our development environment. I'm sure that it is something really silly and simple but I'll be darned if I can figure out what it is. Here's a failure example: I created a simple little C# program called Test1. I added a new class that has a public method Sum, which does the brilliant function of adding two numbers together and returning the result. I added a unit test...
6
5687
by: Vyacheslav Maslov | last post by:
Hi all! I have many many many python unit test, which are used for testing some remote web service. The most important issue here is logging of test execution process and result. I strongly need following: 1. start/end timestamp for each test case (most important) 2. immediate report about exceptions (stacktrace) 3. it will be nice to use logging module for output
20
2438
by: earthwormgaz | last post by:
Hello, I'm after doing some C++ unit testing, I'm using CppUnit. I like the look of RudeMocks, but it doesn't work for Solaris/Sparc, so its no good to me sadly. So, I have class A, and it uses classes B and C. B and C have methods A uses, but they're not virtual, and I don't want to hack the code so that they are just to allow Unit Tests to work. This means that inheriting from B and C to provide Mock classes is a non starter.
2
2603
by: =?Utf-8?B?c2lwcHl1Y29ubg==?= | last post by:
I was wonder if there is any protocol or suggestions on how to setup unit testing projects in large solution??? If you have a large solution of say 50 projects and add a project for every unit test it could get overwhelming - is there some standards on how to set this up??? Has anyone integrated this into Continuous Integration ???
0
8788
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9476
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9335
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9208
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8210
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6053
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4825
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3279
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2193
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.