1. Download and unzip the release. The folder you unzip into will be referred to as "WinUnit".

2. Create a file called MyTests.cpp with the following contents:

  // MyTests.cpp
  
  #include "WinUnit.h"

  BEGIN_TEST(MyFailingTest)
  {
    WIN_ASSERT_TRUE(3 > 4);
  }
  END_TEST

  BEGIN_TEST(MySucceedingTest)
  {
    WIN_ASSERT_TRUE(4 > 3);
  }
  END_TEST

3. Build this file into a DLL from a command prompt as follows:

cl /EHsc /LD /I WinUnit\Include MyTests.cpp

Note: If you are not using a Visual Studio command prompt you will also need to specify the include path for windows.h.

4. Run WinUnit.exe against the DLL produced, MyTests.dll:

WinUnit\bin\WinUnit.exe MyTests.dll

You will see an indication that one test passed and the other failed. Now you can add real tests.

See WinUnit\Documentation\WinUnit.chm for more details on how it works and what kinds of ASSERTs you can use.

Last edited Sep 8, 2009 at 2:10 AM by mkblees, version 1

Comments

No comments yet.