WinUnit: An Outstanding Native C++ Unit Testing Tool

Whew! I can finally talk about one of the coolest pieces of code I’ve seen in ages: WinUnit. About a year ago, my friend, Maria Blees showed me an idea she had for unit testing native C++ code and asked if I thought it was any good. It was far more than good it was outstanding! WinUnit brings NUnit-like testing to native C++ code. What makes WinUnit very nice is that writing tests is easy, but what makes it truly great is it includes the infrastructure to run those tests. That’s what’s been missing from other native testing approaches.

I ported over a good size library I had, which used separate EXE files for testing to use WinUnit. It turned out that I cut the code down by 40% and got 40% more automated code coverage! That’s one heck of a return on your investment.

Maria’s article in MSDN Magazine discusses all the ins and outs of using WinUnit so you can see how to apply it immediately to your code. She even included a set of Visual Studio macros to configure your projects to use WinUnit. Most impressively, she included all her unit tests, written in WinUnit of course.

The most common question I get for native development is “how can I unit test C++?” Now, you have the answer. It’s been killing me to have to hold WinUnit secret until it finally was published in MSDN Magazine. It’s not too often I’m stunned speechless a piece of code any more, but WinUnit was one of those. I can’t recommend WinUnit enough!

Update April 30, 2008: MSDN Magazine broke their years of links recently so I fixed the links.

John Robbins

View Comments

Recent Posts

8-Step AWS to Microsoft Azure Migration Strategy

Microsoft Azure and Amazon Web Services (AWS) are two of the most popular cloud platforms.…

22 hours ago

How to Navigate Azure Governance

 Cloud management is difficult to do manually, especially if you work with multiple cloud…

1 week ago

Why Azure’s Scalability is Your Key to Business Growth & Efficiency

Azure’s scalable infrastructure is often cited as one of the primary reasons why it's the…

3 weeks ago

Unlocking the Power of AI in your Software Development Life Cycle (SDLC)

https://www.youtube.com/watch?v=wDzCN0d8SeA Watch our "Unlocking the Power of AI in your Software Development Life Cycle (SDLC)"…

1 month ago

The Role of FinOps in Accelerating Business Innovation

FinOps is a strategic approach to managing cloud costs. It combines financial management best practices…

1 month ago

Azure Kubernetes Security Best Practices

Using Kubernetes with Azure combines the power of Kubernetes container orchestration and the cloud capabilities…

2 months ago