mirror of
https://github.com/mappu/miqt.git
synced 2025-02-08 22:10:23 +00:00
rcc/test: support PATH separator difference on Windows
This commit is contained in:
parent
dfbe5a0835
commit
d8c52499c1
@ -5,6 +5,7 @@ import (
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
@ -60,6 +61,10 @@ replace github.com/mappu/miqt => ` + filepath.Clean(RccDir+`/../../`) + `
|
||||
// Build miqt-rcc and add it to our fake tools path
|
||||
|
||||
toolsDir := t.TempDir()
|
||||
newPathEnv := "PATH=" + toolsDir + `:` + os.Getenv(`PATH`)
|
||||
if runtime.GOOS == "windows" { // uses a different separator
|
||||
newPathEnv = "PATH=" + toolsDir + `;` + os.Getenv(`PATH`)
|
||||
}
|
||||
|
||||
t.Run("Compile miqt-rcc", func(t *testing.T) {
|
||||
|
||||
@ -116,7 +121,7 @@ replace github.com/mappu/miqt => ` + filepath.Clean(RccDir+`/../../`) + `
|
||||
// Verify that `go generate` works
|
||||
|
||||
regenCmd := exec.Command(`go`, `generate`)
|
||||
regenCmd.Env = []string{"PATH=" + toolsDir + ":" + os.Getenv("PATH")}
|
||||
regenCmd.Env = []string{newPathEnv}
|
||||
regenCmd.Dir = td
|
||||
regenCmd.Stderr = os.Stderr
|
||||
err = regenCmd.Run()
|
||||
|
Loading…
x
Reference in New Issue
Block a user