Code Monkey home page Code Monkey logo

igloo's Introduction

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);
}

igloo's People

Contributors

bcachet avatar dannystaple avatar ereichert avatar joakimkarlsson avatar kimgr avatar nelabidi avatar susu avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.