1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-11-17 18:06:15 -05:00
v2fly/testing/scenarios/server_env_regular.go

28 lines
504 B
Go
Raw Normal View History

2016-08-08 18:55:36 -04:00
// +build !coverage
package scenarios
import (
"os"
"os/exec"
)
func BuildV2Ray() error {
2016-08-09 16:13:16 -04:00
binaryPath := GetTestBinaryPath()
2016-08-08 18:55:36 -04:00
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 {
2016-08-09 16:13:16 -04:00
binaryPath := GetTestBinaryPath()
proc := exec.Command(binaryPath, "-config", configFile)
2016-08-08 18:55:36 -04:00
proc.Stderr = os.Stderr
proc.Stdout = os.Stdout
return proc
}