mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-11-17 18:06:15 -05:00
28 lines
504 B
Go
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
|
|
}
|