Although I have used some unit tests with cppUnit before, I just came across Catch2 and the test samples in the wxWidgets source tree.
After reading the recommended how-to-write-unit-tests.md, and compiling and running the GUI test sample, I still have some very basic questions about how I would go about building my own test - for both GUI & non-GUI functionality.
The .md file only covers things in a very general way and, while I could start with a copy of the test_gui sample and start stripping it down to one of the Catch2 enabled projects, I am hoping someone's experience & comments can save me a lot of time.
Perhaps I should ask in a different part of this forum? If so, please let me know & I'll move my question.
FWIW, running the GUI test samples seems to run to completion only sometimes & only after hanging several times and when it does complete, it shows a long list of memory leaks.
These consideration make me ask before I plunge in and .....
And a very happy new year to all
Using Catch2 UT framework for app testing
Using Catch2 UT framework for app testing
Environment: Win 10/11 64-bit & Mint 21.1
MSVC Express 2019/2022
wxWidgets 3.2.2
MSVC Express 2019/2022
wxWidgets 3.2.2
Re: Using Catch2 UT framework for app testing
Hi,
I would guess that it is the same in your case.
Also, it would be ice to know:
1. Platform/version
2. wx version
3. Compiler/version.
Thank you.
The best way to start something with wxWidgets is to copy the appropriate sample folder, strip it and then add your own code.Widgets wrote: ↑Wed Jan 01, 2020 12:04 am Although I have used some unit tests with cppUnit before, I just came across Catch2 and the test samples in the wxWidgets source tree.
After reading the recommended how-to-write-unit-tests.md, and compiling and running the GUI test sample, I still have some very basic questions about how I would go about building my own test - for both GUI & non-GUI functionality.
The .md file only covers things in a very general way and, while I could start with a copy of the test_gui sample and start stripping it down to one of the Catch2 enabled projects, I am hoping someone's experience & comments can save me a lot of time.
I would guess that it is the same in your case.
Well, does it finish without any assertions or crash? This is the most important when running the unit test.Widgets wrote: ↑Wed Jan 01, 2020 12:04 am Perhaps I should ask in a different part of this forum? If so, please let me know & I'll move my question.
FWIW, running the GUI test samples seems to run to completion only sometimes & only after hanging several times and when it does complete, it shows a long list of memory leaks.
These consideration make me ask before I plunge in and .....
Also, it would be ice to know:
1. Platform/version
2. wx version
3. Compiler/version.
Same to you.
Thank you.
Re: Using Catch2 UT framework for app testing
Well, the 'test' tree is quite large, but if that is the only way .....
As I mentioned, it hangs - no crash as far as I can tell, but I had to kill it and next time it may run to completion or or it may hang again ... something like about 5 -6 cycles, before it completes without a hang after a restart.
Makes me wonder about uninitialized variables, but when I try to interrupt a hang it is so far down the hole that backtracking is too frustrating, especcially until I understand the expected program flow better.
My apologies.
Win 10, MSVC 2019 Community, wxWidgets 3.1.2
Environment: Win 10/11 64-bit & Mint 21.1
MSVC Express 2019/2022
wxWidgets 3.2.2
MSVC Express 2019/2022
wxWidgets 3.2.2
Re: Using Catch2 UT framework for app testing
Hi,
Did you open the wxWidgets\build\msw\wx_vc15.sln and do: "Build->Batch Build->Build ALL"?
Also, at which point does it hangs? Can you post the log from the screen?
No, its not the only way, but its the best way. Creating wx project from scratch is complicated.
Did you build the library itself?Widgets wrote: ↑Thu Jan 02, 2020 3:59 pmAs I mentioned, it hangs - no crash as far as I can tell, but I had to kill it and next time it may run to completion or or it may hang again ... something like about 5 -6 cycles, before it completes without a hang after a restart.
Makes me wonder about uninitialized variables, but when I try to interrupt a hang it is so far down the hole that backtracking is too frustrating, especcially until I understand the expected program flow better.
Did you open the wxWidgets\build\msw\wx_vc15.sln and do: "Build->Batch Build->Build ALL"?
Also, at which point does it hangs? Can you post the log from the screen?
Thank you.
Re: Using Catch2 UT framework for app testing
What I have done:
Download the wxWidgets 3.1.2 package for Windows
Install it all and build my libraries - mainly for statically linked 32-bit apps.
Root for the wxWidgets 3.1.2 tree: D:\MSVC2019\wxWidgets-3.1.2\
Cd to the directory D:\MSVC2019\wxWidgets-3.1.2\tests
Open the .sln file test_gui_vc15.sln
and let MSVC compile the whole works
then run the debug version of test_gui
The test frame window is hidden behind the console window.
Moving the console window to show the test frame seems to sometimes help.
It almost seems as though the tests are waiting for some user input, because it seems tapping the 'Enter' key allows things to move forward, at least some times.
If you look at the test solution under windows, you will see an awful lot of code, and most of it is still using CppUnit style so it is not at all obvious (at least to me) which parts are essential and which relate only to specific projects/tests.
Quite possibly, the UT code includes its own copies of wxWidgets support libs.
But as I have not heard anything else specific, starting with a copy will likely be my next step ... once I finish the bulk of the work which prompted me to look at UT again
Download the wxWidgets 3.1.2 package for Windows
Install it all and build my libraries - mainly for statically linked 32-bit apps.
Root for the wxWidgets 3.1.2 tree: D:\MSVC2019\wxWidgets-3.1.2\
Cd to the directory D:\MSVC2019\wxWidgets-3.1.2\tests
Open the .sln file test_gui_vc15.sln
and let MSVC compile the whole works
then run the debug version of test_gui
The test frame window is hidden behind the console window.
Moving the console window to show the test frame seems to sometimes help.
It almost seems as though the tests are waiting for some user input, because it seems tapping the 'Enter' key allows things to move forward, at least some times.
If you look at the test solution under windows, you will see an awful lot of code, and most of it is still using CppUnit style so it is not at all obvious (at least to me) which parts are essential and which relate only to specific projects/tests.
Quite possibly, the UT code includes its own copies of wxWidgets support libs.
But as I have not heard anything else specific, starting with a copy will likely be my next step ... once I finish the bulk of the work which prompted me to look at UT again
Environment: Win 10/11 64-bit & Mint 21.1
MSVC Express 2019/2022
wxWidgets 3.2.2
MSVC Express 2019/2022
wxWidgets 3.2.2
Re: Using Catch2 UT framework for app testing
Hi,
Yes, moving from crrpunit to catch is not yet complete.
It would be nice to see where the UT is holding and why it is not going...
Thank you.
Yes, moving from crrpunit to catch is not yet complete.
It would be nice to see where the UT is holding and why it is not going...
Thank you.
Re: Using Catch2 UT framework for app testing
Eventually I will get there and report back.
But right now, getting things at least sort-of-working will take precedence
But right now, getting things at least sort-of-working will take precedence
Environment: Win 10/11 64-bit & Mint 21.1
MSVC Express 2019/2022
wxWidgets 3.2.2
MSVC Express 2019/2022
wxWidgets 3.2.2
Re: Using Catch2 UT framework for app testing
My latest tests using the latest code for wxWidgets from Github show no problems with hanging at all.
The 32-bit debug version compiled & ran to completion without a hitch.
It still shows piles of memory leak though.
As well, a very cursory check shows that a lot more of the test have been ported to Catch2; never did an exhaustive check, though for completeness.
The 32-bit debug version compiled & ran to completion without a hitch.
It still shows piles of memory leak though.
As well, a very cursory check shows that a lot more of the test have been ported to Catch2; never did an exhaustive check, though for completeness.
Environment: Win 10/11 64-bit & Mint 21.1
MSVC Express 2019/2022
wxWidgets 3.2.2
MSVC Express 2019/2022
wxWidgets 3.2.2