Giter Site home page Giter Site logo

catch-me2-if-you-can's Introduction

Catch Me2 (if you can)

Pronounced as: Catch Me too (if you can)

Simple C++ test library, header-only. Meant to be compatible drop-in replacement for Catch2: https://github.com/catchorg/Catch2/

Focus on compile speed and compile time memory footprint at cost of features. Supports basic Catch2 features.

Why another test framework?

Catch2 is great, but unfortunately it has known issues to be very slow to compile. They even have dedicated info page for slow compiles: https://github.com/catchorg/Catch2/blob/master/docs/slow-compiles.md

Problem is not just slow compiles, but very heavy memory usage. Simple test with Catch2 can require up to 512MiB memory to be compiled. Sometimes that's just unacceptable.

Benchmarks

There's simple test.sh script to compile and run some test cases from test folder. It prints out the compile times of test with different headers and use cases. On fairly powerful laptop with 16GiB of memory results are:

Catch Me2 single file test:

real    0m0,288s
user    0m0,266s
sys     0m0,022s

Catch Me2 multi file test:

real    0m0,681s
user    0m0,590s
sys     0m0,090s

Catch2 single file test:

real    0m7,436s
user    0m7,165s
sys     0m0,268s

Catch2 multi file test:

real    0m8,311s
user    0m7,943s
sys     0m0,355s

Compile time for Catch Me2 is fraction of Catch2 compile time, still providing same results.

Supported features

  • REQUIRE
  • CHECK
  • REQUIRE_FALSE
  • CHECK_FALSE
  • REQUIRE_THROWS
  • CHECK_THROWS
  • REQUIRE_NOTHROW
  • CHECK_NOTHROW

Please consult Catch2 documentation about usage: https://github.com/catchorg/Catch2/blob/master/docs/assertions.md#top

catch-me2-if-you-can's People

Contributors

jroivas avatar

Watchers

 avatar  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.