All Projects โ†’ martinmoene โ†’ catch-lest-other-comparison

martinmoene / catch-lest-other-comparison

Licence: MIT License
Tabularised feature comparison between Catch, doctest and lest C++ test frameworks

Projects that are alternatives of or similar to catch-lest-other-comparison

arabic-text-diacritization
Benchmark Arabic text diacritization dataset
Stars: โœญ 41 (+105%)
Mutual labels:  comparison
front-end-visual-comparison-tool
๐Ÿ”ฎ๐Ÿ”ฌFront-End testing tool which can be used to create a side by side visual comparison between your live site and local site.
Stars: โœญ 16 (-20%)
Mutual labels:  comparison
amber-router
A URL Routing shard.
Stars: โœญ 16 (-20%)
Mutual labels:  comparison
missCompare
missCompare R package - intuitive missing data imputation framework
Stars: โœญ 31 (+55%)
Mutual labels:  comparison
mrivis
medical image visualization library and development toolkit
Stars: โœญ 19 (-5%)
Mutual labels:  comparison
cpp14-project-template
A simple, cross-platform, and continuously integrated C++14 project template
Stars: โœญ 64 (+220%)
Mutual labels:  doctest
hood
The plugin to manage benchmarks on your CI
Stars: โœญ 17 (-15%)
Mutual labels:  comparison
Multi-Face-Comparison
This repo is meant for backend API for face comparision and computer vision. It is built on python flask framework
Stars: โœญ 20 (+0%)
Mutual labels:  comparison
compare-utils
Compares of Java Collections and Objects (of different classes) made easy
Stars: โœญ 15 (-25%)
Mutual labels:  comparison
bundler-comparison
Comparison of web resource bundlers. ๐Ÿ“ฆ
Stars: โœญ 21 (+5%)
Mutual labels:  comparison
react-compare-slider
A slider component to compare any two React components in landscape or portrait orientation. It supports custom images, videos... and everything else.
Stars: โœญ 78 (+290%)
Mutual labels:  comparison
pdb-benchmarks
Benchmarking common tasks on proteins in various languages and packages
Stars: โœญ 33 (+65%)
Mutual labels:  comparison
Promise
Asynchronous Programming with Promises
Stars: โœญ 15 (-25%)
Mutual labels:  catch
stringosim
String similarity functions, String distance's, Jaccard, Levenshtein, Hamming, Jaro-Winkler, Q-grams, N-grams, LCS - Longest Common Subsequence, Cosine similarity...
Stars: โœญ 47 (+135%)
Mutual labels:  comparison
javascript-serialization-benchmark
Comparison and benchmark of JavaScript serialization libraries (Protocol Buffer, Avro, BSON, etc.)
Stars: โœญ 54 (+170%)
Mutual labels:  comparison
ncdu-diff
ncdu fork that can compare and diff results
Stars: โœญ 21 (+5%)
Mutual labels:  comparison
power-doctest
JavaScript Doctest for JavaScript, Markdown and Asciidoc.
Stars: โœญ 45 (+125%)
Mutual labels:  doctest
zx-spec
A unit testing framework for Sinclair ZX Spectrum assembly
Stars: โœญ 32 (+60%)
Mutual labels:  tdd-framework
pybraincompare
brain image comparison and visualization methods for python!
Stars: โœญ 16 (-20%)
Mutual labels:  comparison
starter
Create vertical search web application in minutes with generator (based on ItemsAPI)
Stars: โœญ 21 (+5%)
Mutual labels:  comparison

Catchโ€“doctestโ€“lest feature comparison

Tabularised feature comparison between Catch, doctest and lest C++ test frameworks.

Skip to the feature comparison.

Note: This is an initial draft, it is incomplete and likely contains errors.

Ideas, additions, corrections, signaling omissions, etc. welcome!


The frameworks in this comparison share the following properties:

  • The frameworks are available as single-file header-only library.
  • Test cases are described by a string, they are not identified by a function name.
  • There is a single assertion macro for expressions.
    Expressions are decomposed and original expression code can be shown alongside the values they represent.
  • Fixtures can be created inside a test case. They are called sections or sub cases.

Advent of Catchโ€ƒExpression-decomposing assertions and function-level fixtures (sections) were introduced by Kevlin Henney in his talk Rethinking Unit Testing in C++ at ACCU London in May 2010 [1]. At that time, Phil Nash was working on a testing framework called YACUTS (Yet Another C++ Unit Test System) that would bring similar capabilities, be it a little more intrusively [2]. Kevlin's talk inspired Phil to develop Catch [3].

Kevlin's emphasis on simplicity in testing and the desire to understand how expression decomposition works inspired Martin Moene to write lest [4]. The code of lest is intentionally kept small, so that it should be fairly easy to gain insight in how things work.

Accompanying test code with the code to test was one of the drivers for Viktor Kirilov to write doctest [5]. Others are to enable using doctest with many different compilers and to shine in compile-time and run-time performance. At CppCon 2017 Viktor gave a presentation that explains many techniques used in doctest and Catch [23].

 

Feature doctest Catch-1 Catch-2 lest Notes
License MIT BSL-1.0 BSL-1.0 BSL-1.0  
           
C++ standard related          
C++ standard C++98 C++98 C++11 C++11  
Can work without exceptions โœ“ - - - reduced functionality
Requires RTTI - - - -  
           
Fields of use          
Desktop โœ“ โœ“ โœ“ โœ“  
Embedded (tiny) ? ? ? ?  
Embedded (largish) ? ? ? โœ“  
Application, tool ? โœ“ โœ“ ?  
Library, framework ? โœ“ โœ“ โœ“  
Operating System ? ? ? โœ“ lest: IncludeOS
           
Documentation of framework         see [22]
First contact ? ? ? ? new users
Education ? ? ? ? new & existing users
Support ? ? ? ? experienced users
Troubleshooting ? ? ? ? annoyed users
Internals ? ? ? ? fellow developers
Reference ? ? ? ? everyone
Try it online โœ“ โœ“ โœ“ โœ“ on wandbox
Forum - โœ“ โœ“ - Catch: Google group
Chat โœ“ - - - doctest: Gitter  
StackOverflow tag - โœ“ โœ“ - see [19]
           
Test organisation          
Suites of tests โœ“ - - -  
Fixtures (sections) โœ“ โœ“ โœ“ โœ“ doctest: sub case
Fixtures (class-based) โœ“ โœ“ โœ“ -  
Type-parameterised tests โœ“ โœ“ โœ“ -  
Value-parameterised tests - - - -  
Auto-registration of tests โœ“ โœ“ โœ“ โœ“  
Tabularised tests - - - โœ“ array of lambdas
Allow tests accompany code โœ“ โœ“ โœ“ - Catch: not recommended...
Allow tests in header files โœ“ โœ“ โœ“ - ...to avoid long compilation times
           
Assertions          
BDD style scenarios โœ“ โœ“ โœ“ โœ“  
Assert expressions โœ“ โœ“ โœ“ โœ“  
Assert exceptions โœ“ โœ“ โœ“ โœ“  
Assert abortion (death) - - - -  
Assert assertions (death) - - - -  
Expression decomposition โœ“ โœ“ โœ“ โœ“ see [2]
Floating point comparison, approx โœ“ โœ“ โœ“ โœ“  
Floating point comparison, ULP - - โœ“ - see stf [10]
Hamcrest matchers (built-in) - some some โ€ข see [12][13][14][15]
Hamcrest matchers (user-definable) - โœ“ โœ“ -  
Macros with and without prefix โœ“ โœ“ โœ“ โœ“ CATCH_CHECK(), CHECK()
           
Other test facilities          
Mocking support โ€ข โ€ข โ€ข โ€ข via 3rd party
Logging facility โœ“ โœ“ โœ“ -  
Logging levels - - - -  
Checkpoints - - - - see Boost.Test [11]
Test decorators โœ“ - - - see [16]
Test data generators - โ€ข - - Cach-1: undocumented
Property-based testing - - - -  
Obtain name of current test ? โ€ข ? - Catch-1: undocumented
           
API / seams          
Reporting user-defined types โœ“ โœ“ โœ“ โœ“  
Reporter API - โœ“ โœ“ -  
Event listeners - โœ“ โœ“ -  
Run-time context โœ“ โœ“ โœ“ -  
           
Reporting formats          
Console, multi-line โœ“ โœ“ โœ“ -  
Console, single-line (compact) - โœ“ โœ“ โœ“ similar to compiler error
JUnit - โœ“ โœ“ - result at end
XML - โœ“ โœ“ - streaming
TeamCity - โœ“ โœ“ -  
TAP - โœ“ โœ“ -  
Automake - โœ“ โœ“ -  
           
Reporting options          
Colourised output (run-time) โœ“ โœ“ โœ“    
Colourised output (compile-time) โœ“ - - โœ“  
Literal suffix u, l, f - - - โœ“ compile-time
           
Test execution          
Concurrent execution of tests - - - -  
Isolated execution of tests - - - -  
Limit test execution time โœ“ - - - doctest: via test decorator
Signal tests without assertions - โœ“ โœ“ -  
Supports floating point exceptions - - - -  
Supports Posix signals โœ“ โœ“ โœ“ -  
Supports Windows SEH โœ“ โœ“ โœ“ -  
           
Compile-time control          
Improve compilation speed โœ“ โœ“ โœ“ - reduced functionality
Omit macros without prefix โœ“ โœ“ โœ“ โœ“  
Omit std::wstring - - - โœ“  
Omit std::cout, cerr, clog - โœ“ โœ“ -  
Specify terminal color system โœ“ โœ“ โœ“ - none, ansi, win32
Specify terminal width - โœ“ โœ“ -  
Control handling of POSIX signals โœ“ โœ“ โœ“ -  
Control handling of SE on Windows โœ“ โœ“ โœ“ -  
Enable leak checking on Windows - โœ“ โœ“ - uses CRT Debug Heap
Enable use of __COUNTER__ - โœ“ โœ“ - for internal unique names
           
Run-time control, commandline          
Help screen โœ“ โœ“ โœ“ โœ“  
List selected suites โœ“ - - -  
List selected tests โœ“ โœ“ โœ“ โœ“  
List tags of selected tests - โœ“ โœ“ โœ“  
Select tests by suite โœ“ - - -  
Select tests by name โœ“ โœ“ โœ“ โœ“  
Select tests by tag โœ“ โœ“ โœ“ โœ“  
Select tests by file โœ“ โœ“ โœ“ - Catch: via filename as tags
Select section by name โœ“ โœ“ โœ“ -  
Select supports regexp โœ“ - - โœ“  
Omit assertions expected to throw - โœ“ โœ“ -  
Count selected tests โœ“ - - โœ“  
Abort at N-th failure โœ“ โœ“ โœ“ โœ“ lest: N is 1
Break into debugger โœ“ โœ“ โœ“ -  
Report passing tests โœ“ โœ“ โœ“ โœ“  
Time duration of tests โœ“ โœ“ โœ“ โœ“  
Control order of tests โœ“ โœ“ โœ“ โœ“  
Repeat tests - โœ“ โœ“ โœ“  
           
IDE integration         see [17]
Output-window-compatible reports โœ“ โœ“ โœ“ โœ“ click through to source
C++ Builder ? ? ? ?  
CLion โœ“ โœ“ โœ“ -  
Code::Blocks ? ? ? ?  
CodeLite ? ? ? ?  
Eclipse CDT ? ? ? ?  
KDevelop ? ? ? ?  
Qt Creator ? ? โœ“ ?  
Visual-MinGW ? ? ? ?  
Visual Studio โ€ข โ€ข โ€ข - Catch and doctest: via ReSharper C++
Visual Studio Code - - - - see issue
           
Platforms          
AIX / XL ? 11.1.0 ? ? Catch-1: 2013
macOS / clang ? ? ? ?  
macOS / gcc 4.4-6 ? ? ? source: Travis
macOS / XCode / clang 6.4-8.3 7.3-8 7.3-8 ? source: Travis
macOS / XCode / gcc 6.4-7.3 7.3-8 7.3-8 ? source: Travis
Linux / clang 3.4-4 3.4-3.8 3.5-3.8 3.6-3.7 source: Travis
Linux / gcc 4.4-6 4.4-6 4.8-6 4.9-5 source: Travis
Solaris / SunPro ? 5.12.0 ? ? Catch-1: 2013
Windows / clang ? ? ? 3.2+  
Windows / gcc 7 ? ? 4.8.1+  
Windows / Visual C++ 9-15 10-15 14-15 12-15 Catch-1: possibly from 8
Windows / Cygwin / clang ? ? ? ?  
Windows / Cygwin / gcc ? ? ? ?  
Windows / msys2 / clang ? ? ? ?  
Windows / msys2 / gcc ? ? ? ?  
           
Quality of project         note: challenge 42
Code of conduct - โœ“ โœ“ -  
Follows CII best practices โœ“ partly partly partly see [21]
           
Quality of code          
Unit testing โœ“ โœ“ โœ“ โœ“ details below
CI testing โœ“ โœ“ โœ“ โœ“ details below
CI code analysis โœ“ - - - details below
           
Testing of framework          
Unit tests โœ“ โœ“ โœ“ โœ“  
Tests itself โœ“ โœ“ โœ“ โœ“  
Baseline tests โœ“ โœ“ โœ“ -  
           
CI testing          
Travis โœ“ โœ“ โœ“ โœ“  
Appveyor โœ“ โœ“ โœ“ โœ“  
Coverage scan โœ“ - โœ“ -  
Coverity scan โœ“ - - -  
           
CI static code analysis          
clang-tidy โœ“ - - -  
CppCheck โœ“ - - -  
CppCoreCheck - - - -  
PVS-Studio - - - -  
OCLint โœ“ - - -  
ReSharper C++ - - - -  
Visual Studio โœ“ - - -  
           
Code-related          
Compile-time performance, relative โ˜†โ˜†โ˜† โ˜†โ˜† ? ? see [20]
Run-time performance, relative โ˜†โ˜†โ˜† โ˜†โ˜† ? ? see [20]
Compiler-warning friendly โ˜†โ˜†โ˜† โ˜†โ˜† โ˜†โ˜† โ˜†โ˜†  
Compiles with -Werror -Wall -Wextra โœ“ โœ“ โœ“ โœ“  
Can provide canned main() โœ“ โœ“ โœ“ -  
Only depends on C++ std library โœ“ โœ“ โœ“ โœ“  
Single-file header-only โœ“ โœ“ โœ“ โœ“  
Size, LOC 4,500 9,100 8,800 1,000 see [18]
           
Distribution of framework          
GitHub single-file download โœ“ โœ“ โœ“ โœ“ from the landing page
conan โœ“ โœ“ โœ“ -  
hunter โœ“ ? - -  
vcpkg โœ“ โœ“ โœ“ -  
Linux and other (search) search โ†’ search search on Repology
           
Feature doctest Catch-1 Catch-2 lest Notes

References

[1] Kevlin Henney. Rethinking Unit Testing in C++ (Video). Skills Matter, May 2010.
[2] Phil Nash. The Ultimate C++ Unit Test Framework. Blog, May 2010.
[3] Phil Nash. Unit Testing in C++ and Objective-C just got easier. Blog announcement, December 2010.
[4] Martin Moene. lest errors escape testing. Blog announcement, June 2013.
[5] Viktor Kirilov. doctest โ€“ the Lightest C++ Unit Testing Framework. Announcement in Overload 137, February 2017.
[6] Phil Nash. Catch-1 on GitHub. 2010.
[7] Phil Nash. Catch-2 on GitHub. 2017.
[8] Viktor Kirilov. doctest on GitHub. 2014.
[9] Martin Moene. lest on GitHub. 2013.
[10] Joel Falcou. Design rationale for using ULP with stf.
[11] Gennadiy Rozental and Raffi Enficiaud. Checkpoints in Boost.Test.
[12] Matchers in Catch-1.
[13] Matchers in Catch-2.
[14] Matchers in lest: via hamlest.
[15] Hamcrest 1.3 Quick Reference (PDF).
[16] Decorators in doctest.
[17] Wikipedia. List of C++ IDEs.
[18] CodeBlocks IDE. Non-empty, non-comment lines, via File > Properties.
[19] StackOverflow. Questions tagged catch-unit-test.
[20] Viktor Kirilov. doctest Benchmarks. May 2017.
[21] Linux Foundation (LF). CII Best Practices.
[22] Jacob Kaplan-Moss. Writing great documentation.
[23] Viktor Kirilov. Mix Tests and Production Code With Doctest - Implementing and Using the Fastest Modern C++ Testing Framework (slides). CppCon 2017.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].