#! /usr/bin/perl
+
+# Copyright (c) 2012-2014. The SimGrid Team.
+# All rights reserved.
+
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the license (GNU LGPL) which comes with this package.
+
eval 'exec perl -S $0 ${1+"$@"}'
if $running_under_some_shell;
my $path = $0;
my $OS;
my $enable_coverage=0;
+my $sort_prefix = 19;
my $tesh_file;
my $tesh_name;
my $error=0;
if ($cmd{'sort'}){
sub mysort{
- $a cmp $b
+ substr($a, 0, $sort_prefix) cmp substr($b, 0, $sort_prefix)
}
- use sort qw(defaults _quicksort); # force quicksort
+ use sort 'stable';
@got = sort mysort @got;
+ while (@got and $got[0] eq "") {
+ shift @got;
+ }
+
#also resort the other one, as perl sort is not the same as the C one used to generate teshes
if(defined($cmd{'out'})){
@{$cmd{'out'}}=sort mysort @{$cmd{'out'}};
+ while (@{$cmd{'out'}} and ${$cmd{'out'}}[0] eq "") {
+ shift @{$cmd{'out'}};
+ }
}
}
%cmd = ();
}
$cmd{'sort'} = 1;
+ if ($line =~ /^!\s*output sort\s+(\d+)/) {
+ $sort_prefix = $1;
+ }
}
elsif($line =~ /^!\s*output ignore/){ #output ignore
if (defined($cmd{'cmd'})) {