From 5fc8de90720212ff1b859658a0f959ceef9c2aad Mon Sep 17 00:00:00 2001 From: Olivier Vielpeau Date: Wed, 7 Sep 2016 16:19:05 +0200 Subject: [PATCH] [rake] Set `PKG_CONFIG_LIBDIR` env var for `go test` too Otherwise go can't build (and test) the packages that need the env var to be set correctly. --- Rakefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Rakefile b/Rakefile index e6931607c17a..e800e4d1f814 100644 --- a/Rakefile +++ b/Rakefile @@ -51,7 +51,7 @@ task :test => %w[fmt lint vet] do Dir.glob("#{t}/**/*").select {|f| File.directory? f }.each do |pkg_folder| # recursively search for go packages next if Dir.glob(File.join(pkg_folder, "*.go")).length == 0 # folder is a package if contains go modules profile_tmp = "#{pkg_folder}/profile.tmp" # temp file to collect coverage data - system("go test -short -covermode=count -coverprofile=#{profile_tmp} #{pkg_folder}") + system({"PKG_CONFIG_LIBDIR" => "#{PKG_CONFIG_LIBDIR}"}, "go test -short -covermode=count -coverprofile=#{profile_tmp} #{pkg_folder}") if File.file?(profile_tmp) `cat #{profile_tmp} | tail -n +2 >> #{PROFILE}` File.delete(profile_tmp)