Coder Social home page Coder Social logo

Unit Testing about openloco HOT 6 CLOSED

openloco avatar openloco commented on May 12, 2024
Unit Testing

from openloco.

Comments (6)

IntelOrca avatar IntelOrca commented on May 12, 2024 1

Just go with gtest, I already set up some for our proposed shared library between OpenRCT2 and OpenLoco:
https://github.com/IntelOrca/libsawyer/

from openloco.

janisozaur avatar janisozaur commented on May 12, 2024

I introduced google test to openrct2 and at the time the 1.8.0 release was still fresh. I think gtest does a fine job of providing test framework and has some unique capabilities (like death tests). I ran into some minor issues with gtest which I tried to fix upstream, but it looks like the project is all but abandoned, don't be fooled by the commits that are being made to the googletest repository, they're all for gmock.

For this reason I would consider switching to Catch2, which has matured a lot since the time unit testing was introduced to openrct2.

I'm fine if the test frameworks differ between the two repos, time has shown we don't touch the test code as often for this to be a major problem and we never used the benefits that only gtest provides. That said, gtest is still a strong contender, it does it's job perfectly fine.

from openloco.

IntelOrca avatar IntelOrca commented on May 12, 2024

I unit test frameworks for C++ are just horrible but there is nothing we can do about that. I am fine with whatever.

I don't know if there is a VS test adaptor for Catch2 though where as there is one for gtest.

from openloco.

LeftofZen avatar LeftofZen commented on May 12, 2024

I'd love to add some unit testing, does anyone have updated thoughts on GTest vs Catch2, or any other test framework?

Personally I've used GTest before at a previous workplace and haven't used Catch2 before, but I don't have a preference on which framework we use.

Glancing at their respective GitHub pages, they both used a similar macro-style way of declaring tests, both have VS test adapters, both are being updated reasonably frequently. GTest does have way more documentation than Catch2 though.

from openloco.

LeftofZen avatar LeftofZen commented on May 12, 2024

Easy, I'll try submit a PR some time over the weekend to add GTest

from openloco.

AaronVanGeffen avatar AaronVanGeffen commented on May 12, 2024

Closing this, as we have introduced the GTest framework and started adding tests for particular modules since.

from openloco.

Related Issues (20)

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.