ut
Experimental Boost.DI
Our great sponsors
ut | Experimental Boost.DI | |
---|---|---|
10 | 8 | |
1,195 | 1,097 | |
1.7% | 1.7% | |
7.0 | 3.5 | |
about 1 month ago | 6 days ago | |
C++ | C++ | |
Boost Software License 1.0 | - |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
ut
-
[C++20][safety] static_assert is all you need (no leaks, no UB)
I don't think stepping through static_assert is a thing? Curious if it is, though. Since constexpr is either run-time or compile-time and static_assert is not a poor man's debugging facility could be to -Dstatic_assert(...) assert(__VA_ARGS__) and gdb the code. Alternatively, a more refined solution would be to use an UT framework (for example https://github.com/boost-ext/ut) which helps with that. IMHO, TDD can also limit the requirement of stepping into the code and with gurantees that the code is memory safe and UB safe there is less need for sanitizers and valgrind etc. depending on the coverage.
-
snatch -- A lightweight C++20 testing framework
It was not easy, I had to modify Boost UT to get it to run my tests. It doesn't support type-parametrized tests when the type parameter is non-copiable, which was the case for me. This is a symptom of a larger issue, which is that it relies on std::apply and std::tuple to generate the type-parametrized tests, which in turns requires instantiating the tuple and the contained objects (even though these instances aren't actually used; eh). That's a no go for me, since I need to carefully monitor when instance are created, and this was throwing off my test code. I had to effectively disable these checks to get it to run without failures. Then there was a similar issue with expect(), which doesn't work if part of the expression is non-copiable. I reported these issues to them.
-
[C++20] New way of meta-programming?
https://github.com/boost-ext/ut (for better user interface when defining tests without macros)
-
Getting started with Boost in 2022
https://github.com/boost-ext/ut from Kris Jusiak is worth checking
- How to unit test
-
Calculate Your Code Performance
C++: C++ has quite a number of benchmarking libraries some of the recent ones involving C++ 20's flexibility. The most notable being Google Bench and UT. C does not have many specific benchmarking libraries, but you can easily integrate C code with C++ benchmarking libraries in order to test the performance of your C code.
-
Benchmarking Code
UT
-
Another C++ unit testing framework without macros
In Boost.UT there is a number of different styles to add a parametrized test case. All of them are pretty cryptic bue to heavy isage of oeverloaded operators of custom "non-public" classes. Except for the for-loop method, in all other methods the list of parameter values goes after the test procedure definition. I find this inconvenient, as I want to see list of parameter value next to the test name. This is what I used to from the times I was coding a lot of unit tests in C#.
Experimental Boost.DI
-
What are some cool modern libraries you enjoy using?
I love: https://github.com/boost-ext/di for dependency injection
-
[C++20] New way of meta-programming?
https://github.com/boost-ext/di (To detect constructor parameters and inject dependencies without runtime dispatch)
-
Dependency injection
I was looking to try boost.di for some time, looks nice. https://boost-ext.github.io/di/
- Dependency injection with c++
-
Architecture of a Qt application
Things like Dependency Injection/Inversion are a little more cumbersome in C++ but certainly can be done, and I believe there's libraries for that as well (found a couple searching around, like fruit and boost-ext di ).
-
Jodd – The Unbearable Lightness of Java
Dependency injection does not have to be dynamic, it can totally be done at compile time. Boost DI is an example: https://boost-ext.github.io/di/
- DI in c++ hurt by lack of good libraries?
-
Top five C/C++ things/tips/tricks you wish you had known earlier and are now used very often
Funny you mention dependency injection, proposed Boost.DI shall be up for Boost peer review probably in March. https://boost-ext.github.io/di/
What are some alternatives?
Boost.Test - The reference C++ unit testing framework (TDD, xUnit, C++03/11/14/17)
kangaru - 🦘 A dependency injection container for C++11, C++14 and later
Catch - A modern, C++-native, test framework for unit-tests, TDD and BDD - using C++14, C++17 and later (C++11 support is in v2.x branch, and C++03 on the Catch1.x branch)
American Fuzzy Lop - american fuzzy lop - a security-oriented fuzzer
FakeIt - C++ mocking made easy. A simple yet very expressive, headers only library for c++ mocking.
c-smart-pointers - Smart pointers for the (GNU) C programming language
doctest - The fastest feature-rich C++11/14/17/20/23 single-header testing framework
gcc-poison - gcc-poison
test - A library for writing unit tests in Dart.
outcome - Provides very lightweight outcome<T> and result<T> (non-Boost edition)
KmTest - Kernel-mode C++ unit testing framework in BDD-style
stb - stb single-file public domain libraries for C/C++