Skip to content

Commit 544a695

Browse files
committed
genhtml: Ensure stable block order in branch output
Sort order of basic blocks in output of branch coverage data. This allows for a better comparison of output between test cases. Signed-off-by: Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
1 parent 477957f commit 544a695

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

bin/genhtml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3893,6 +3893,14 @@ END_OF_HTML
38933893
# *************************************************************
38943894
}
38953895

3896+
sub cmp_blocks($$)
3897+
{
3898+
my ($a, $b) = @_;
3899+
my ($fa, $fb) = ($a->[0], $b->[0]);
3900+
3901+
return $fa->[0] <=> $fb->[0] if ($fa->[0] != $fb->[0]);
3902+
return $fa->[1] <=> $fb->[1];
3903+
}
38963904

38973905
#
38983906
# get_branch_blocks(brdata)
@@ -3936,7 +3944,7 @@ sub get_branch_blocks($)
39363944
$block->[scalar(@{$block}) - 1]->[$BR_LEN]++;
39373945
}
39383946

3939-
return @blocks;
3947+
return sort(cmp_blocks @blocks);
39403948
}
39413949

39423950
#

0 commit comments

Comments
 (0)