Skip to content

Commit

Permalink
cunit.pl: add suites to project in sorted order
Browse files Browse the repository at this point in the history
This disregards the ordering in Makefile.am (which is unimportant)
and arranges suites to run in alphabetic order (which is readable)
  • Loading branch information
elliefm committed Aug 23, 2023
1 parent 2fffdc5 commit a9bb893
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions cunit/cunit.pl
Original file line number Diff line number Diff line change
Expand Up @@ -810,9 +810,7 @@ ($)
#
# Note: appending is an important semantic. It ensures
# that the order of suites in the CUnit run matches the
# order in which test source is specified, in SUBDIRS
# in the top-level Makefile and then in TESTSOURCES
# in each Makefile below that.
# order in which they were added (alphabetic)
#
vmsg("adding suite $suite->{relpath} $suite->{basedir}");
push(@suites, $suite);
Expand Down Expand Up @@ -872,7 +870,12 @@ (@)

project_load();

foreach my $path (@args)
# Test sources are listed mostly alphabetically in Makefile.am, but
# there are exceptions for uninteresting reasons.
# There should not be any order dependency, so we can disregard the
# order they were listed in, and instead force them into alphabetic
# order for better readability of the test suite output.
foreach my $path (sort @args)
{
die "$path: not a C source file"
unless (-f $path && $path =~ m/\.(test)?(c|C|cc|cxx|c\+\+)$/);
Expand Down

0 comments on commit a9bb893

Please sign in to comment.