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

Function TestBuildNativeCommand_NoArgs

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

Source from the content-addressed store, hash-verified

134}
135
136func TestBuildNativeCommand_NoArgs(t *testing.T) {
137 var displayCmd string
138 executor := NewExecutor("", `call "C:\VC\vcvarsall.bat" x64 && cmake --build .`)
139 cmd := executor.buildNativeCommand(&displayCmd)
140
141 if displayCmd != executor.command {
142 t.Errorf("displayCmd = %q, want %q", displayCmd, executor.command)
143 }
144 if cmd.Path != "" && !strings.HasSuffix(strings.ToLower(cmd.Path), "cmd.exe") {
145 t.Errorf("expected cmd.exe, got: %s", cmd.Path)
146 }
147 if cmd.SysProcAttr == nil {
148 t.Fatal("expected SysProcAttr to be set")
149 }
150 if cmd.SysProcAttr.CmdLine != `/c call "C:\VC\vcvarsall.bat" x64 && cmake --build .` {
151 t.Errorf("CmdLine = %q, unexpected value", cmd.SysProcAttr.CmdLine)
152 }
153 if !cmd.SysProcAttr.HideWindow {
154 t.Error("expected HideWindow to be true")
155 }
156}
157
158func TestBuildNativeCommand_WithArgs(t *testing.T) {
159 var displayCmd string

Callers

nothing calls this directly

Calls 3

NewExecutorFunction · 0.85
buildNativeCommandMethod · 0.80
ErrorMethod · 0.80

Tested by

no test coverage detected