SPM + GTest

If you need to expose a C++ library with #gtest via #spm, there is a straightforward way to wrap existing tests with #xctest:

1. Add gmock as a .systemLibrary target in your Package.swift and link it to your .testTarget.

2. Create a module map and an umbrella header for gmock.

3. Create an Obj-C++ adapter that wraps GoogleTest with XCTestCase.

🚀 CMD + U

Покрытие процедурного кода в ООП проекте юнит-тестами в C++

Legacy проекты на С++ зачастую являются многокомпонентными, когда продукт использует несколько библиотек, которые имеют различную архитектуру для работы с ними. Обычно это: библиотеки, поставляемые как ООП решение (Некоторые модули boost, SOCI как пример) библиотеки, реализованные в функциональном стиле (OpenGL через С API, POSIX как пример) Из-за этого в итоговом проекте появляются сущности, которые внутри реализованы через классы, но внутри методов класса идет обращение к обычным функциям. Некоторые библиотеки имеют специфичные функции, которые для своей работы требуют первоначальную инициализацию. Как пример: поиск подключенных устройств и получение на них ссылок для дальнейшей работы или функции, которые требуют инициализации большого количества памяти. Вследствие этого возникает вопрос - как лучше реализовать покрытие юнит-тестами специфичных объектов, которые внутри себя имеют функции, требующие специальных условий для своей работы?

https://habr.com/ru/companies/megafon/articles/914372/

#c++ #gtest #google_testing_framework #mocking #unittesting #unittests

Покрытие процедурного кода в ООП проекте юнит-тестами в C++

Общая картина Legacy проекты на С++ зачастую являются многокомпонентными, когда продукт использует несколько библиотек, которые имеют различную архитектуру для работы с ними. Обычно это: библиотеки,...

Хабр

Ok. I am very bad at unit tests. I would like to create some. This is on #macos; we use #cmake for the most part, and the #gtest suite for tests, but I'm ok if I can only make something for #xcode

One issue I don't understand is: in Swift, if I want to use a substitute class for a system one (specifically, NEAppProxyFlow and its subclasses)... how do I handle that? Do I provide my own module "NetworkExtension" for the unit tests? Or something else?

We've been working toward deprecating GTest for our testing library in favor of our in-house JTest testing library. J3ML our 3D math library is the current target for rewriting our unit tests to utilize JTest.

#C++ #TestingLibrary #GTest #GameDev #UnitTesting

Trying to make https://github.com/kaitai-io/kaitai_struct_cpp_stl_runtime/pull/48 work - would be great to have access to #OpenBSD or #DragonFly box to test, ideally with various byte order configurations

Currently it seems to be completely broken i.e. tests do not pass even if the bswap16/bswap32/bswap64 functions are used for #FreeBSD and #NetBSD.

After rebasing,

/home/saper/src/kaitai_struct_cpp_stl_runtime/tests/unittest.cpp:36: Failure
Expected equality of these values:
ks.read_f4le()
Which is: -9.6157696e+09
3.14159f
Which is: 3.1415901

#DragonFlyBSD #gtest #byteorder

Make it compile on *BSD by reezer · Pull Request #48 · kaitai-io/kaitai_struct_cpp_stl_runtime

With this change compilation on the BSDs will work.

GitHub

I wrote about my first experiences with the #meson build system and with #GTest framework to test #C++ code.

In the while I also wrote a simple #logging library compatible with #MPI.

https://blog.movimento-centrale.it/posts/mpilogger_meson_and_gtest/

Logging under MPI, Meson and Gtest - movimento centrale

There cannot be good software without an automated and reproducible build system, better if it comes with tests. I wrote before on how to achieve that with CMake and Catch2. Today I’m going to experiment with Meson and Gtest, and the example is going to be less trivial than the previous time. Digression: we need a logger! I deal with quite a bit of scientific software, and unfortunately most of us scientist suffer from the “Works for me” syndrome.

Anyone here a #googletest #gtest contributor and willing to take a look at my PR? Boosts very welcome :3

https://github.com/google/googletest/pull/4402

Add public interface for XmlUnitTestResultPrinter by LittleFox94 · Pull Request #4402 · google/googletest

Allowing custom gtest_main implementations to instantiate the XmlUnitTestResultPrinter with either a given file path or any other kind of std::ostream to write to. This is useful for e.g. embedded ...

GitHub

Okay, so when using #gtest / #gmock / #googletest to write C++ unit tests for code that uses dependency injection, how the *hell* do go about mocking dependencies of a class under test without having to mock the dependency class' dependencies, and *those* class' dependencies, and so on until you've mocked every class in the dependency tree of the class under test?

"Interfaces" or "templates" are *not* valid answers, as they drive complexity into your non-test code purely to support testing!

En train de découvrir le fonctionnement de la monnaie Ğ1 via @monnaielibreoccitanie

Je me suis inscrit sur ĞTest afin de me familiariser quelqu'un pour me certifier?

Inscrit sous Tigre-Bleu
voici ma clef publique: 8dDufS4JUkW1yEf753ibamHsLR5GJKF9NL6cGnMbiygW

#duniter #gtest #ğtest #cesium #sakia #basicincome