1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-22 18:17:52 -05:00
v2fly/testing/scenarios/server_env_regular.go
2016-08-09 22:13:16 +02:00

28 lines
504 B
Go

// +build !coverage
package scenarios
import (
"os"
"os/exec"
)
func BuildV2Ray() error {
binaryPath := GetTestBinaryPath()
if _, err := os.Stat(binaryPath); err == nil {
return nil
}
cmd := exec.Command("go", "build", "-tags=json", "-o="+binaryPath, GetSourcePath())
return cmd.Run()
}
func RunV2Ray(configFile string) *exec.Cmd {
binaryPath := GetTestBinaryPath()
proc := exec.Command(binaryPath, "-config", configFile)
proc.Stderr = os.Stderr
proc.Stdout = os.Stdout
return proc
}