ocornut / imgui_test_engine

Dear ImGui Automation Engine & Test Suite
386 stars 40 forks source link

Would you consider having an option to disable the coroutine? #4

Closed elect86 closed 1 year ago

elect86 commented 1 year ago

As titled, in my case, my motivation is essentially to have the code follow deterministic pattern for our Kotlin port

However, if this may make sense for other scenarios as well, then it might be worth implementing it

Ps: sorry if I opened an issue, but there is no discussion available

ocornut commented 1 year ago

(Sorry posted too early by accident, reposting.)

Hello,

I don't understand your question, this seems like a XY Problem.

The co-routine system is essential to be able to express tests with linear code. I don't see the relationship with your statement "follow deterministic pattern", it's entirely deterministic.

As explained in https://github.com/ocornut/imgui_test_engine/wiki/Setting-Up#setting-up-custom-coroutines-interface the co-routine interface is best implemented with two threads mutually blocking each others. There is never any form of parallelism.

(Opening an Issue is fine.)

elect86 commented 1 year ago

Deterministic in the way that every action (click, opening menu, etc) takes place at the exact i-th run of main body

With coroutines, there is no guarantee about that

ocornut commented 1 year ago

Deterministic in the way that every action (click, opening menu, etc) takes place at the exact i-th run of main body

This is the case.

With coroutines, there is no guarantee about that

Read the explanation on wiki and let me know.

elect86 commented 1 year ago

I'll close for the moment

elect86 commented 1 year ago

@ocornut if I'd like to use the NULL backend/ImguiApp implementation, how shall I do?

ocornut commented 1 year ago

We compile using the std::thread implementation of the coroutines functions so that should work, that’s how we run most of our tests on CI.