Skip to content
joakimkarlsson edited this page Sep 13, 2010 · 10 revisions

Igloo is a unit testing framework for C++ that aims to provide a way to write tests that

  • Has an assertion model that is easy to read
  • Provides a model to write test fixtures that seamlessly fit with the way you write classes in C++

Example

#include "igloo.h"
using namespace igloo;

TestFixture(Assertions)
{
  virtual void SetUp()
  {
  }

  virtual void TearDown()
  {
  }

  TestMethod(ShouldHandleIntegerAssertions)
  {
    Assert::That(5, Is().Not().EqualTo(4));
  }

  TestMethod(ShouldHandleStrings)
  {
    Assert::That("joakim", Is().Not().EqualTo("harry"));
  }
};

int main()
{
  return TestRunner::RunAllTests();
}
Clone this wiki locally