utest.h icon indicating copy to clipboard operation
utest.h copied to clipboard

Add support for execution order

Open windowsair opened this issue 7 months ago • 5 comments

#170

This patch adds support for the execution order of cases. Users can define a non-negative ORDER value to determine the execution order of cases. Cases with a smaller ORDER value will be executed first.

Add following macros:

  • UTEST_ORDER(SET, NAME, ORDER)
  • UTEST_F_ORDER(FIXTURE, NAME, ORDER)
  • UTEST_I_ORDER(FIXTURE, NAME, INDEX, ORDER)

windowsair avatar May 22 '25 14:05 windowsair

Just to check - if we just always sorted the tests by name, would that be sufficient rather than this?

sheredom avatar May 22 '25 15:05 sheredom

Do you want something like a default execution order? I'd prefer the order to be determined by the definition sequence of macros rather than names.

windowsair avatar May 22 '25 15:05 windowsair

Naw naw the patch is fine, just wanted to double check that wouldn't work for you first before approving :)

sheredom avatar May 22 '25 15:05 sheredom

Oh, I'm not sure why the CI failed. It seems unrelated to the new code.

windowsair avatar May 24 '25 03:05 windowsair

Looks like CI passed! I changed the code so that the default behavior should not change :)

windowsair avatar Jun 19 '25 11:06 windowsair