Hazel icon indicating copy to clipboard operation
Hazel copied to clipboard

Unit Tests

Open Puddlestomper opened this issue 5 years ago • 5 comments

It looks like Hazel will expand to become quite a large and complicated code base (as is common for game engines). Because of this Cherno is making many temporary compromises in order to get things working so long. For example the hard-coded magnification settings in the Textures video. This will eventually lead to us refactoring a lot of code as a proper material system, asset manager, etc. gets added.

I think it is probably a good idea to have a unit test system so that if this refactoring (or anything else) breaks something unexpectedly, then we will be able to find where the issue is and hopefully fix it quickly without too much debugging.

I am not experienced enough to know how to actually go about doing this, but it seems like something that should be done at some point.

Puddlestomper avatar Aug 22 '19 18:08 Puddlestomper

Yeah this is definitely a thing that should be done at some point. There are a lot of good unit test c++ libraries out there, the one I recommend is doctest.

d-tatianin avatar Oct 05 '19 09:10 d-tatianin

I'd definately like to see some unit testing framework implemented, I've played around with a few (non-game related projects) but not sure if I'm using them in the correct way for in game-engine context so some info on that would be great.

SweeneyPro avatar Dec 14 '19 16:12 SweeneyPro

This is a great idea to avoid breaking one thing when trying to fix another. I never really worked with C ++ testing, but this https://github.com/catchorg/Catch2íritu looks great

JonanOribe avatar Nov 03 '20 13:11 JonanOribe

There is also the googletest framework (https://github.com/google/googletest), which has both testing and mocking facilities.

pmann84 avatar Feb 24 '21 00:02 pmann84

Just if someone knows how to create OpenGL context in CI (Travis-CI ie) I would like to know how to do that. I already tried but you cannot create OpenGL even with Docker.

Lecrapouille avatar Feb 24 '21 21:02 Lecrapouille