Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

codewars/igloo

Open more actions menu
 
 

Repository files navigation

igloo

Build Status

A framework for unit testing in C++

Igloo is a unit testing framework for C++ that aims to:

  • stay out of your way and let you focus on what you want to test
  • help you create readable tests
  • have a syntax that doesn’t make you repeat yourself

Example

The following is a complete test application written in Igloo

#include <igloo/igloo_alt.h>
using namespace igloo;

Describe(a_guitar_with_a_fuzzbox)
{
  void SetUp()
  {
    guitar.AddEffect(fuzzbox);
  }

  It(starts_in_clean_mode)
  {
    Assert::That(guitar.Sound(), Equals(Clean));
  }

  Describe(in_distorted_mode)
  {
    void SetUp()
    {
      Parent().fuzzbox.Switch();
    }

    It(sounds_distorted)
    {
      Assert::That(Parent().guitar.Sound(), Equals(Distorted));
    }

    It(sounds_clean_when_I_switch_the_fuzzbox)
    {
      Parent().fuzzbox.Switch();
      Assert::That(Parent().guitar.Sound(), Equals(Clean));
    }
  };

  Fuzzbox fuzzbox;
  Guitar guitar;
};

int main(int argc, const char *argv[])
{
  return TestRunner::RunAllTests(argc, argv);
}

About

A framework for unit testing in C++

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • C++ 90.9%
  • C 7.8%
  • Other 1.3%
Morty Proxy This is a proxified and sanitized view of the page, visit original site.