From c4f72cf2dad992864d7df3b0e1cfa1ed7d9b21d8 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Wed, 6 Jul 2011 11:50:09 -0700 Subject: [PATCH] build: run tests in cmd directories with gotest, not Make Change-Id: Ib56ce9c243418f2a5925f3e6b5b3677fa466d7b9 --- build.pl | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/build.pl b/build.pl index d1781531d..184745691 100755 --- a/build.pl +++ b/build.pl @@ -147,6 +147,7 @@ if (@matches > 1) { } build($matches[0]); +test($matches[0]); sub v { return unless $opt_verbose; @@ -278,12 +279,16 @@ sub test { my @test_files = grep { /_test\.go$/ } readdir($dh); closedir($dh); if (@test_files) { - 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"; + if ($target =~ m!\blib/go\b!) { + my @quiet = ("--silent"); + @quiet = () if $opt_verbose; + if (system("make", @quiet, "-C", dir($target), "test") != 0) { + die "Tests failed for $target\n"; + } + } else { + if (system("cd $target && gotest") != 0) { + die "gtest failed for $target\n"; + } } } }