Giter Site home page Giter Site logo

dtest's Introduction

Dtest

Dtest is a library specialized to test data.

  1. Features

  1. Simple component
  • Able to write complex tests with simple Dtest components.
  1. Highly-optimized assertion
  • Most of Dtest assertions will be in-line-expanded and executed fast.
  1. Each assertion stands for an assertion
  • Each assertion has a name, and this means "a test case".
  1. Each assertion returns its result
  • Able to control testing flows freely with results of tests.
  1. Written with predicates
  • To make finding the meaning of each test easy.
  1. Output expressed in CSV format
  • To make analysing results easy.
  1. Headers only
  • Easy to use.
  1. Images

Coding tests

// create test manager
dtest::DtestManager manager;

// set the output stream
std::ofstream ofs("dtest_log.csv");
manager.SetOutputStream(&ofs);
manager.PrintHeader();

// run (i.e.)
for (auto it = container.begin(); it != container.end(); ++it) {
  manager.TestThat("TestName1", it->value1, dtest::Eq(0), "AdditionalMessage");
  manager.TestThat("TestName2", it->value2, dtest::AllOf(dtest::Gt(1), dtest::Lt(5)));
}

Check output

The content of output file "dtest_log.csv" is like below.

TestName1,1,is == 0,AdditionalMessage
TestName2,0,(is > 1) and (is < 5),
TestName1,2,is == 0,AdditionalMessage
  1. License

Dtest is released under the MIT License, see LICENSE.

Some Dtest source codes are generated by pump.py. See https://code.google.com/p/googletest/wiki/PumpManual

dtest's People

Watchers

James Cloos avatar Yu Mochizuki 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.