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 fits with the way you write classes in C++

Example

#include "igloo.hpp"

TestFixture(Assertions)
{
public:

  virtual void SetUp()
  {
  }

  virtual void TearDown()
  {
  }

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

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

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