Loading util/pl/unix.pl +36 −4 Original line number Diff line number Diff line Loading @@ -189,13 +189,18 @@ sub fixtests sub fixdeps { my ($str) = @_; my ($str, $fakes) = @_; my @t = split(/\s+/, $str); $str = ''; foreach my $t (@t) { $str .= ' ' if $str ne ''; if (exists($fakes->{$t})) { $str .= $fakes->{$t}; next; } if ($t =~ /^[^\/]+$/) { $str .= '$(TEST_D)/' . $t; Loading Loading @@ -265,6 +270,7 @@ sub get_tests my %deps; my %tests; my %alltests; my %fakes; while (my $line = <M>) { chomp $line; Loading @@ -287,7 +293,22 @@ sub get_tests || $line =~ /^(?<t>test_(ss|gen) .*):(?<d>.*)/) { my $t = $+{t}; $deps{$t} = $+{d}; my $d = $+{d}; # If there are multiple targets stupid FreeBSD make runs the # rules once for each dependency that matches one of the # targets. Running the same rule twice concurrently causes # breakage, so replace with a fake target. if ($t =~ /\s/) { ++$fake; my @targets = split /\s+/, $t; $t = "_fake$fake"; foreach my $f (@targets) { $fakes{$f} = $t; } } $deps{$t} = $d; $deps{$t} =~ s/#.*$//; for (;;) { Loading Loading @@ -326,7 +347,7 @@ sub get_tests $d =~ s/\.\.\/apps/\$(BIN_D)/g; $d =~ s/\.\.\/util/\$(TEST_D)/g; $d = fixtests($d, \%tests); $d = fixdeps($d); $d = fixdeps($d, \%fakes); my $r = $targets{$t}; $r =~ s/\.\.\/apps/..\/\$(BIN_D)/g; Loading Loading @@ -392,7 +413,18 @@ sub get_tests $scripts .= "\nocsp:\n\tcp -R test/ocsp-tests \$(TEST_D)\n"; $scripts .= "\smime:\n\tcp -R test/smime-certs \$(TEST_D)\n"; my $all = 'test: ' . join(' ', keys %alltests); my $all = 'test:'; foreach my $t (keys %alltests) { if (exists($fakes{$t})) { $all .= " $fakes{$t}"; } else { $all .= " $t"; } } return "$scripts\n$copies\n$tests\n$all\n\n$each"; } Loading Loading
util/pl/unix.pl +36 −4 Original line number Diff line number Diff line Loading @@ -189,13 +189,18 @@ sub fixtests sub fixdeps { my ($str) = @_; my ($str, $fakes) = @_; my @t = split(/\s+/, $str); $str = ''; foreach my $t (@t) { $str .= ' ' if $str ne ''; if (exists($fakes->{$t})) { $str .= $fakes->{$t}; next; } if ($t =~ /^[^\/]+$/) { $str .= '$(TEST_D)/' . $t; Loading Loading @@ -265,6 +270,7 @@ sub get_tests my %deps; my %tests; my %alltests; my %fakes; while (my $line = <M>) { chomp $line; Loading @@ -287,7 +293,22 @@ sub get_tests || $line =~ /^(?<t>test_(ss|gen) .*):(?<d>.*)/) { my $t = $+{t}; $deps{$t} = $+{d}; my $d = $+{d}; # If there are multiple targets stupid FreeBSD make runs the # rules once for each dependency that matches one of the # targets. Running the same rule twice concurrently causes # breakage, so replace with a fake target. if ($t =~ /\s/) { ++$fake; my @targets = split /\s+/, $t; $t = "_fake$fake"; foreach my $f (@targets) { $fakes{$f} = $t; } } $deps{$t} = $d; $deps{$t} =~ s/#.*$//; for (;;) { Loading Loading @@ -326,7 +347,7 @@ sub get_tests $d =~ s/\.\.\/apps/\$(BIN_D)/g; $d =~ s/\.\.\/util/\$(TEST_D)/g; $d = fixtests($d, \%tests); $d = fixdeps($d); $d = fixdeps($d, \%fakes); my $r = $targets{$t}; $r =~ s/\.\.\/apps/..\/\$(BIN_D)/g; Loading Loading @@ -392,7 +413,18 @@ sub get_tests $scripts .= "\nocsp:\n\tcp -R test/ocsp-tests \$(TEST_D)\n"; $scripts .= "\smime:\n\tcp -R test/smime-certs \$(TEST_D)\n"; my $all = 'test: ' . join(' ', keys %alltests); my $all = 'test:'; foreach my $t (keys %alltests) { if (exists($fakes{$t})) { $all .= " $fakes{$t}"; } else { $all .= " $t"; } } return "$scripts\n$copies\n$tests\n$all\n\n$each"; } Loading