Sort test output according order in the source file

When developing new feature or creating tests for upcoming bugfix, I usually try to create all possible tests, most of them will fail at that moment. Then I go through test output and fix that tests. In order to keep things in mind, I fix tests in that order as it appears in the source file, but, unfortunally, test output not follow that order. It would be useful to sort output of the test command, or always or with flag

1 Like

There is no option for this. The tests are always alphabetically sorted:

It shouldn't be too hard to add an option to disable this sort though.

This has been done since

It was likely done in part as before that commit the order of the printed failures was dependend on the order in which the tests actually failed, which is non-deterministic in presence of multithreading. The current code doesn't have this problem anymore.

1 Like

Well, while for CI reports, alphabetical output may be more convenient, when analyzing errors, it is desirable to view the tests from top to bottom and follow the test log in the same order, i.e. sort the output according to the test positions in the file.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.