home.social

#gtest — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #gtest, aggregated by home.social.

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

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

    habr.com/ru/companies/megafon/

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

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

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

    blog.movimento-centrale.it/pos

  4. 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!

  5. 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!

  6. 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!

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

  8. 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!