lethal-guitar / RigelEngine

A modern re-implementation of the classic DOS game Duke Nukem II
GNU General Public License v2.0
911 stars 60 forks source link

WIP #846 Initial idea for unit tests for ModLibrary #919

Open bencsikandrei opened 7 months ago

bencsikandrei commented 7 months ago

hi, @lethal-guitar hope you're doing well!

I've noticed you closed this issue: #846. Why? I just came up with, I think, a cool idea to solve it!

I'm not there yet, but inching closer. Need to get some sleep soon (real late here) but if you approve of this idea, I'll absolutely go the extra mile!

Main points:

Add a fileshystem "stub" (handle?) for the filesystem functions used in ModLibrary::rescan ideas: make a struct with function pointers, why?

very veeeery much WIP, didn't test much apart from building the code and the unit test, didn't even have time to step through the debugger, it's really late, this commit message will change :)

@lethal-guitar what do you think? worth pursuing?

here's some logs from the current unit test (it's very basic of course):

andrew@pop-os:~/Projects/RigelEngine$ ./build/gcc-11-Debug/test/tests 
2024-01-27 23:27:28.900 (   0.000s) [        8FE553C0]        mod_library.cpp:127   INFO| { rescan
2024-01-27 23:27:28.900 (   0.000s) [        8FE553C0]        mod_library.cpp:131   INFO| .   Listing mod directories
2024-01-27 23:27:28.900 (   0.000s) [        8FE553C0]        mod_library.cpp:157   INFO| .   Found 0 mods
2024-01-27 23:27:28.900 (   0.000s) [        8FE553C0]        mod_library.cpp:162   INFO| .   No previous mod library, creating default selection
2024-01-27 23:27:28.900 (   0.000s) [        8FE553C0]        mod_library.cpp:127   INFO| } 0.000 s: rescan
===============================================================================
test cases: 1 | 1 passed
assertions: - none -
lethal-guitar commented 7 months ago

Hi @bencsikandrei, good to see you back and thanks for the PR! I closed the issue but it's still relevant, you're very welcome to work on it if you're interested. Basically, I recently did a bit of cleanup and closed a whole bunch of issues that I don't realistically see myself getting around to anytime soon - I don't really have much time for the project at the moment. But reviewing and discussing should be doable.

I'll have a closer look at the proposal when I have time, and let you know what I think!