wxWidgets / wxWidgets

Cross-Platform C++ GUI Library
https://www.wxwidgets.org/
5.77k stars 1.7k forks source link

GUI version for test application #6591

Closed wxtrac closed 2 years ago

wxtrac commented 20 years ago

Issue migrated from trac ticket # 6591

component: samples | priority: normal

2004-04-07 16:37:29: abxabx (WÅ‚odzimierz Skiba) created the issue


This is the GUI interface to the Unit tests. I did it to add possibility of runing tests which operate on GUI elements like modifications of Menu, capturing birmaps from display, some measuring sizes in sizers etc. etc.

Since this is supposed to be possible to run this test in WinCE (not tested yet) I deleted tests entry in Bakefiles.bkgen.

I extended CppUnit library with wxOutputter specific to wxWidgets since I couldn't adjust text interface of CppUnit to my needs. Now it is possible in the future to modify internals of wxOutputter so it for example could output info using wxHTML, STC or another feature of wxW like rich text decoration.

Menus display all components of test suits but only most top items in submenus run tests (those with prefix "Run ").

Delivered icon is only in ICO format. Please add XPM version (I have only viewers to XPM).

Unlike in tex2rtf I decided to have GUI interface in separated cpp module to avoid those unreadable #ifdefs.

wxtrac commented 20 years ago

2004-04-07 16:37:30: abxabx (WÅ‚odzimierz Skiba) uploaded file test_gui.patch (3.1 KiB)

Modifications to delivered test_gui

wxtrac commented 20 years ago

2004-04-07 16:38:34: abxabx (WÅ‚odzimierz Skiba) uploaded file test_gui.cpp (16.9 KiB)

test_gui application source code

wxtrac commented 20 years ago

2004-04-07 16:39:30: abxabx (WÅ‚odzimierz Skiba) uploaded file test.ico (0.7 KiB)

icon for application

wxtrac commented 20 years ago

2004-04-07 16:40:25: abxabx (WÅ‚odzimierz Skiba) uploaded file test.rc (0.0 KiB)

resource specification for test_gui

wxtrac commented 20 years ago

2004-04-08 14:20:21: @vslavik commented


This is the GUI interface to the Unit tests.

Sorry, but what is it useful for? It's much easier to run tests from command line than from some GUI...

I did it to add possibility of runing tests which operate on GUI elements like modifications of Menu, capturing birmaps from display, some measuring sizes in sizers etc. etc.

You don't need GUI interface to CppUnit to be able to do this. Instead, what is needed is a way to (repeatedly) create wxApp, run a test in it and shut it down. It's essential that this can be run in exactly same way as command-line interface works now (including its textual output) so that it can be run automatically.

Delivered icon is only in ICO format. Please add XPM version (I have only viewers to XPM).

If this is for app icon only, you should consider using the resources from samples/ directory, no need to have special icon for test. BTW, can you please post your patches as single patch files instead of patches for bakefiles and code and new files as separate attachments? TIA!

wxtrac commented 20 years ago

2004-04-08 14:42:36: abxabx (WÅ‚odzimierz Skiba) commented


You don't need GUI interface to CppUnit to be able to do this. Instead, what is needed is a way to (repeatedly) create wxApp, run a test in it and shut it down. It's essential that this can be run in exactly same way as command-line interface works now (including its textual output) so that it can be run automatically.

Sorry, I didn't know about it. I will close my patch for now and bring a new one later.

BTW, can you please post your patches as single patch files instead of patches for bakefiles and code and new files as separate attachments? TIA!

Sorry, I couldn't find an option in my diff tool to include content of new files in output so I did it that way. I will investigate options once again.

wxtrac commented 20 years ago

2004-04-10 21:38:30: @vslavik commented


Sorry, I didn't know about it. I will close my patch for now and bring a new one later.

Thanks!

Sorry, I couldn't find an option in my diff tool to include content of new files in output so I did it that way. I will investigate options once again.

diff -P does the trick.