pthom / imgui_bundle

Dear ImGui Bundle: an extensive set of Ready-to-use widgets and libraries, based on ImGui. Start your first app in 5 lines of code, or less. Whether you prefer Python or C++, this pack has your back!
https://pthom.github.io/imgui_bundle/
MIT License
592 stars 63 forks source link

Include Dear ImGui Tests/Automation Engine #133

Closed kuchi closed 8 months ago

kuchi commented 9 months ago

Would there be a possibility to include the Test/Automation Engine into the bundle and python wrapping?

https://github.com/ocornut/imgui_test_engine/wiki/Overview

This would allow for creating automated tests and generating screen shots for documentation. It would be extremely helpful for app development and maintenance.

pthom commented 9 months ago

Hi,

I never worked the the imgui test engine, so I do not know how complex its integration might be, although I suspect it would require a sizable amount work in order to integrate it.

Its API is quite extensive, i.e. there are lots of header files. Which part if the API would you like to access via bindings? Is imgui_te_context.h enough?

The license for imgui_test_engine differs from Dear ImGui license so that I can probably not include it by default in the bundle, and I would have to contact @ocornut concerning the best way to handle this.

Anyhow, let's discuss this by email.

Thanks!

ocornut commented 9 months ago

The context.h is indeed the biggest api surface to wrap.

technically the license makes it free as in free beer for open-source software, which means you are include it in a library like bundle, but it would be up to end user to figure out if they can use it in their project. It would be good to resurface the licence in a binding.

pthom commented 9 months ago

@kuchi : thanks for the suggestion about imgui_test_engine, it is effectively quite interesting. I began to work on the its integration inside HelloImGui (which is included in ImGui Bundle), with the intent to provide a very easy way to integrate it in any app. Later, I'll work on integrating it in ImGui bundle. In a previous message, I mentioned that we could discuss this by email: this was only a suggestion, we can also discuss this here. And anyhow, the integration of imgui_test_engine seems to be a good idea to me!

kuchi commented 9 months ago

@pthom: Sorry to be slow to get back to you - I just sent you an email as well. I wasn't sure if you had an automated method for generating the wrappers for ImGui Bundle or if it was being done manually. I didn't want to suggest something that would be a large amount of work. However, if it is something I can help support that would hopefully be a nice way to give back to the project.

I was primarily interested in using the test engine to be able to test the user interfaces and generate documentation. So yes, the imgui_te_context.h does appear to have all the functions that would be useful of automating gut input for testing.

The functions for capturing screen shots or videos for documentation are probably not necessary to wrap. It is quite easy to use OpenGl in python to directly capture the frame buffer for screen shots and video generation for documentation use. So I think what you have proposed would work very well. Admittedly, I haven't directly used the engine yet since I'm still actively developing tools with your wrapper (and translating quite a few I have already developed from previous python wrappers).

Thank you again for all your great work on this and of course thanks to @ocornut for his amazing work on Dear ImGui.

kuchi commented 9 months ago

The context.h is indeed the biggest api surface to wrap.

technically the license makes it free as in free beer for open-source software, which means you are include it in a library like bundle, but it would be up to end user to figure out if they can use it in their project. It would be good to resurface the licence in a binding.

@ocornut - I have emailed you requesting more information on options for licensing the Test Engine and ways to support Dear ImGui.

pthom commented 9 months ago

@kuchi: for your information, I started to work on integrating imgui_test_engine into HelloImGui as a preamble.

You can see a demo of the current status. As far as screen captures are concerned, I have been in contact with Omar about this, in order to solve some related issues

pthom commented 8 months ago

v1.0.0 is out and support ImGui Test Engine!