supertuxkart / stk-code

The code base of supertuxkart
Other
4.47k stars 1.05k forks source link

Allow running unit tests without assets #3321

Open qwertychouskie opened 6 years ago

qwertychouskie commented 6 years ago

The unit tests currently require the assets, though it probably should not. See https://github.com/supertuxkart/stk-code/pull/3130.

hiker commented 5 years ago

After some discussion here our preferred solution for unit testing: 1) Add a new file that controls all unit tests (i.e. move the corresponding function out of main.cpp) 2) Do a test as the second statement in main (i.e. after initialising CommandLine):

   if(CommandLine::has("--unit-testing")  ...
i.e. without loading any assets.

3) modify all existing unit tests to work without assets. The tests that need a model/texture/... could initially be disabled, or we could add a second command line option (--unit-test-with-assets). Long term: we can include some very limited assets (i.e. a model and a texture or two) to a data/test directory for re-enabling more tests.

Considering the very very limited amount of testing, I set this as a very low priority, though it would still be great to get this (and more tests) in!!

hiker commented 5 years ago

3328 included unit testing by downloading the required assets. While we want to avoid this, I leave the reference here in case some code there would be useful.