Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add '-list-tests' cmdline option #28

Conversation

akmal-threepointsix
Copy link
Contributor

  • I added new command line option -list-tests.
  • It prints all tests from app->TestsAll in the following format:

Test: 'category' 'name'

  • In command line you must run imgui_test_suite.exe -list-tests and the output looks the following way:

image

What you might not like:

  • I included imgui_te_internal.h header, which presumably should not be included anywhere (because it is internal)
  • I added early return on line 559, which is sometimes considered as antipattern

Why I opened this PR?

  • Idk, to be honest, it is not an important change.
  • It allows developers to print all test cases in command line, so if they just want to look at what tests were written for test_imgui_suite app, they won't have to run the whole app UI and ImGUI Test Engine UI.
  • Also, it is kind of an example for developers on how they can print ImGUI Test Engine tests in their own applications.
  • Finally, outputs in command line can be piped, e.g. you could save a list of tests to txt file by executing imgui_test_engine.exe -list-tests > text.txt

@akmal-threepointsix
Copy link
Contributor Author

Btw, I am coming from The Open-Smartwatch project (https://github.com/Open-Smartwatch/open-smartwatch-os).

We use ImGUI in our emulator, so we wrote our UI tests using ImGUI Test Engine. The code is quite ugly, but demo videos look cool:

@ocornut
Copy link
Owner

ocornut commented Aug 15, 2023

Hello,

Thanks for this. I have merged your commit as 1605937 then amended it with 4ab8e39.
Renamed the option to "-list", made it support filters (e.g. -list "^table") and exposed test list and test queue.

Great to see the test engine useful for your project!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants