--list-tests show different case order between Linux and Windows
My test cases are strongly dependent on the execution order. I noticed that on Linux, the execution order is the same as the order in which the UTEST() macro is defined, while on Windows, it's the reverse.
Is there any mechanism to ensure the order of test case execution? Thanks!
It seems to be an issue with the execution order of attribute((constructor)). Can we let users specify a order? If that make sense, I will submit a PR.
Oh interesting. How would they specify an order?
Just use this:
__attribute__((constructor[(priority)]))
Where priority is an optional integer value denoting the priority. A constructor with a low integer value runs before a constructor with a high integer value. A constructor with a priority runs before a constructor without a priority.
We can define something like UTEST_ORDER (SET, NAME, ORDER) using this mechanism :)
Oh, this seems to only work with GCC. Maybe it's a good idea to handle this at runtime.