Skip to content

Add a way to run Unit Tests#679

Merged
twostars merged 16 commits intoOpen-KO:masterfrom
stefannikolei:sn/tests
Dec 14, 2025
Merged

Add a way to run Unit Tests#679
twostars merged 16 commits intoOpen-KO:masterfrom
stefannikolei:sn/tests

Conversation

@stefannikolei
Copy link
Contributor

No description provided.

This adds googletest to enable unit tests.
Made a directory and integrated it into CMake.
Also created an basic workflow for github to run the tests.

Integration into VS is missing
@twostars
Copy link
Collaborator

When you hook up the existing VS solutions, be sure to generate a fetch wrapper with deps/fetch-and-build-wrappers/generate-fetch-wrapper.cmd. It'll prompt accordingly.

If it's header only, you don't need an MSVC project for it (but I would assume this isn't header only).

If it isn't header only, you'll probably have to generate its project files with CMake first, move it to deps/googletest-msvc and then go through and clean up the .vcxproj (and .vcxproj.filters) file to fix the paths and strip the redundant config.

What I would do is take the file, but use one of the others as a base.
What you'll want to keep is the name, the project's guid, the file list and take note of any special preprocessor macros they set.

Then just plug those parts into the one you copied as a base.

I think that's generally how I approach them.

stefannikolei and others added 12 commits December 13, 2025 19:38
* Separate MSVC client & server tests projects

* Move to Server/tests and Client/tests

* Don't bother implementing/building client-tests in CMake; there's no project for N3Base_client etc yet anyway

* Build & run tests in build_msbuild_all.yml workflow

* Tidy up CMakeLists.txt; don't contaminate the global include path (this should have used the target implementation, but googletest's
  CMake project already does this once referenced so it's fine)
Only googletest should've been in here.
The path is relative to the repository so it should be fine.
@twostars twostars marked this pull request as ready for review December 14, 2025 14:15
@twostars twostars merged commit 12b1e7c into Open-KO:master Dec 14, 2025
18 checks passed
@stefannikolei stefannikolei deleted the sn/tests branch December 14, 2025 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants