build: run tests in cmd directories with gotest, not Make

Change-Id: Ib56ce9c243418f2a5925f3e6b5b3677fa466d7b9
This commit is contained in:
Brad Fitzpatrick 2011-07-06 11:50:09 -07:00
parent 443cfd5268
commit c4f72cf2da
1 changed files with 11 additions and 6 deletions

View File

@ -147,6 +147,7 @@ if (@matches > 1) {
}
build($matches[0]);
test($matches[0]);
sub v {
return unless $opt_verbose;
@ -278,13 +279,17 @@ sub test {
my @test_files = grep { /_test\.go$/ } readdir($dh);
closedir($dh);
if (@test_files) {
if ($target =~ m!\blib/go\b!) {
my @quiet = ("--silent");
@quiet = () if $opt_verbose;
if (system("make", @quiet, "-C", dir($target), "test") != 0) {
use Data::Dumper;
print Dumper($t);
die "Tests failed for $target\n";
}
} else {
if (system("cd $target && gotest") != 0) {
die "gtest failed for $target\n";
}
}
}
}