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
590 stars 62 forks source link

test engine logging and headless #208

Closed csuckow closed 1 month ago

csuckow commented 2 months ago

Hi again!

I looked at the example for exporting the results and wanted to reproduce the same behavior in python with the following line: imgui.test_engine.get_io(hello_imgui.get_imgui_test_engine()).export_results_filename = "output_file.xml" However, it does not seem to be accessible at the moment. Is there a way to use the native logging with imgui_bundle? Also, I'd be really interested in a way to run the test engine headless, but I was not quite sure how to achieve that when using hello_imgui, so if you have any advice on this topic, I'd be very thankful.

Thanks a lot!

pthom commented 2 months ago

Hi,

Example:

runner_params.platform_backend_type = hello_imgui.PlatformBackendType.null
runner_params.renderer_backend_type = hello_imgui.RendererBackendType.null

Please tell me if that helps

pthom commented 1 month ago

Hi,

To get a successful export, you will need to do this:

    engine = hello_imgui.get_imgui_test_engine()

    engine.io.export_results_filename_set("output.xml")
    engine.io.export_results_format = imgui.test_engine.TestEngineExportFormat.j_unit_xml

This issue took me half a day of work. Can you give me more information about the context in which you are using the test engine?

Thanks!

csuckow commented 1 month ago

Hey there,

thank you very much for the effort, I really appreciate it. I'll test it as soon as I can next week when I'm back from my vacation, but this looks like it should do the trick.

For context: we have built a simple 3d viewer for debug purposes using just the pure python OpenGL backends. With the time, we have added more and more functionality, but are prone to regressions as we don't have any tests at the moment. That's why I'm experimenting with a prototype in hello-imgui to see if a migration to it would be feasible. I currently imagine some sort of headless automatized ui Tests and manual viewer tests whenever we changed something, as it probably still needs our OpenGL context. This is something I'll have to look into next week.

Again, thank you very much for your dedication to this project.

csuckow commented 1 month ago

I just tried out the newest version and this is working pretty well. Thanks a lot!🥇