From 27f3401848b89b312ec8a3628f2174ada2b484b8 Mon Sep 17 00:00:00 2001 From: v2ray Date: Tue, 9 Aug 2016 01:16:29 +0200 Subject: [PATCH] update coverage profile location --- testing/scenarios/server_env_coverage.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/testing/scenarios/server_env_coverage.go b/testing/scenarios/server_env_coverage.go index ae46fcb1..2c69d3dd 100644 --- a/testing/scenarios/server_env_coverage.go +++ b/testing/scenarios/server_env_coverage.go @@ -5,6 +5,7 @@ package scenarios import ( "os" "os/exec" + "path/filepath" ) func BuildV2Ray() error { @@ -21,7 +22,12 @@ func BuildV2Ray() error { } func RunV2Ray(configFile string) *exec.Cmd { - proc := exec.Command(binaryPath, "-config="+configFile, "-test.run=TestRunMainForCoverage", "-test.coverprofile=coversingle.out") + profile := "coversingle.out" + wd, err := os.Getwd() + if err != nil { + profile = filepath.Join(wd, profile) + } + proc := exec.Command(binaryPath, "-config", configFile, "-test.run", "TestRunMainForCoverage", "-test.coverprofile", profile) proc.Stderr = os.Stderr proc.Stdout = os.Stdout