Closed lefouvert closed 3 months ago
Yes, the core::testing
module and test
functions are supposed to be used in unit tests.
At the moment these are only used as part of the build processes.
I.e. you will find a lot of to2 tests in these folders:
The corresponding test-runners are theses (which are themselves regular xunit tests):
std::
modules: https://github.com/untoldwind/KontrolSystem2/blob/master/KSP2Runtime-Test/TO2StdTestSuite.csAt the moment this is the only way to run to2-testsuits. I am not sure if it makes sense to add an in-game UI for this. ... maybe as an extension for the vscode plugin
Ok, I get it. That's why I didn't found how to launch them, I was missing the C# part ^^. As I have succeed to build the project on VSC (at the cost of 6 hours of tries and researches, because of NuGgets didn't update by themselves, and the MSbuild builder is severely outdated when it really need to be build from «dotnet»), I should be able to run my unity tests. I'm not sure an ingame interface is needed to run the unity test, I think your are right, a VSC plugin should be enought. (The best of the best would be to be able to compile TO2 code directly from VSC, if it's not already the case. Sometimes, I launch the game only for this). But as already said, I come from very old fashioned practice (I still work on a terminal !), where unity test are run handly (with debugger capture to show data) and reported on Word. An awfull way imho. So it's expected I struggle a little bit to fluently found thoses processes and Xunit is not an know way to work for me. And my vision could be outdated.
I think there is a problem with the current version of msbuild
. I am still using msbuild 15.0 which seems to work fine for linux and windows.
This issue is stale because it has been open for 60 days with no activity.
How I'm supposed to implement new features to my code since you added custom unit tests D':`, Now I have to test all my code !
(Joking, it's for the best)
This issue is stale because it has been open for 60 days with no activity.
This issue was closed because it has been inactive for 14 days since being marked as stale.
version 0.5.2.5 (Ckan)
I saw than
core::testing
give use access to what seems to be tools for unity test. Since it's a better practice to test our code, I want to give it a try.So there is this function : console::unit.to2
As I want to test it, I made this very basic function (inspired from std::lambert_test) : test::console::unit.to2
the last test case
(expectedHour: 0, expectedMinute: 0, expectedSecond: 47.56382901, givenTimespan: 11147.56382901)
is obviously wrong and should fail the test.How could I run this test since it's not when code is compiled ? When and where does
fail_test
prompt his message ?