MCPcopy Create free account
hub / github.com/celer-pkg/celer / TestBuildMSYS2Command_MsvcEnvsOrder

Function TestBuildMSYS2Command_MsvcEnvsOrder

pkgs/cmd/exec_windows_test.go:116–134  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

114}
115
116func TestBuildMSYS2Command_MsvcEnvsOrder(t *testing.T) {
117 executor := NewExecutor("", "make install", "DESTDIR=/tmp").
118 SetMsvcEnvs(`call "C:\VC\vcvarsall.bat" x64 > nul &&`)
119
120 var displayCmd string
121 cmd := executor.buildMSYS2Command(&displayCmd)
122
123 parts := strings.SplitN(displayCmd, " ", 2)
124 if !strings.HasPrefix(parts[0], "call") {
125 t.Errorf("msvcEnvs should come first in displayCmd, got: %s", displayCmd)
126 }
127
128 bashCmd := cmd.Args[2]
129 msvcIdx := strings.Index(bashCmd, "call")
130 cmdIdx := strings.Index(bashCmd, "make install")
131 if msvcIdx > cmdIdx {
132 t.Errorf("msvcEnvs should appear before command in bash command, got: %s", bashCmd)
133 }
134}
135
136func TestBuildNativeCommand_NoArgs(t *testing.T) {
137 var displayCmd string

Callers

nothing calls this directly

Calls 3

NewExecutorFunction · 0.85
SetMsvcEnvsMethod · 0.80
buildMSYS2CommandMethod · 0.80

Tested by

no test coverage detected