Git Product home page Git Product logo

mosquitonet's People

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

mosquitonet's Issues

Implement tagging of tests and contexts

Tags

Motivation

There are many reasons to tag a test or context:

  • Hiding tests.
  • Marking tests type: e.g. benchmark, unit, integration. Or marking a test as slow.
  • Providing an alternate hierarchy to the default context.

Different tags may be defined in different ways. For example, combining the hidden tag at different points in the hierarchy would flatten them
into one hidden tag.

A hierarchical tag would concatenate the tags into one compound tag.

The user should be able to specify which tags are mandatory, and have this checked by the type system.

Implementation

By default Suite is a type aliasf for TaggedSuite<>. TaggedSuite would take a variadic list of mandatory tag types. The constructor would take the variadic mandatory tags from the constructor + a variadic list of tags that are optional. Tags should derive from a virtual base TagBase.
They can be moved into a unique_ptr to erase the type.

The signature of context(...) would look like:

template<typename Tag>
using IsTag = enable_if_t<is_base_of<TagBase, Tag>::value>*;

template<
    typename Tag,
    typename... Args,
    enable_if_t<is_base_of<TagBase, Tag>::value>* = nullptr
>
auto context(Tag tag, Args&&...);

template<
    typename Fixture,
    typename... Args,
    enable_if_t< ! is_base_of<TagBase, Fixture>::value>* = nullptr
>
auto context(Functor tag, Args&&...);

TagBase would look like:

template<typename Tag>
struct TagBase {
    virtual ~TagBase() {}
    virtual unique_ptr<TagBase> product(vector<Tag> tagHierarchy) = 0;
    virtual string type() = 0;
    virtual string value() = 0;
};

Tags would be matched via --tag <type:regexp>.

Boost License

Change the license to boost and include a copy of it at the start of every source file.

Exception checking

The idea is that where you'd write if (someFailureConditon) throw..., you could write if (canThrow(someFailureCondition)) throw.... In production, canThrow would always return it's argument. In the test harness, it will fail the 1st successful canThrow, then the next and so on until nothing fails. It wouldn't expect tests to pass (except on the last run), but expect them not to crash.

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.