Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

ShortCUT - A Short C++ Unit Testing Framework

, 15 Feb 2007
A very simple, customizable unit-testing framework for C++ developers
shortcut_demo.zip
shortcut_demo
shortcut.exe
shortcut_src.zip
shortcut_src
#include "shortcut.h"
#include "unittest.h"

int main(int argc, char* argv[])
{
#if 1
    // Creating tests manually
    TestRunner runner;
    MySuite1 mysuite1;
    MySuite1Test1 mysuite1case1;
    MySuite1Test2 mysuite1case2;
    MySuite1Test3 mysuite1case3;

    mysuite1.AddTest(&mysuite1case3);
    mysuite1.AddTest(&mysuite1case2);
    mysuite1.AddTest(&mysuite1case1);
    runner.AddSuite(&mysuite1);
    runner.RunTests();
#else
    // Creating tests the macro way
    TestRunner runner2;
    T_ADDSUITE(runner2, suite10, MySuite1);
    T_ADDTEST(suite10, 100, MySuite1Test1);
    T_ADDTEST(suite10, 101, MySuite1Test2);
    runner2.RunTests();
#endif
    
    return 0;
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Todd-Lucas
Web Developer
United States United States
I work as a developer in the Seattle area. I am currently residing in France.

| Advertise | Privacy | Mobile
Web01 | 2.8.140721.1 | Last Updated 16 Feb 2007
Article Copyright 2007 by Todd-Lucas
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid