(t *testing.T)
| 134 | } |
| 135 | |
| 136 | func 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 | |
| 158 | func TestBuildNativeCommand_WithArgs(t *testing.T) { |
| 159 | var displayCmd string |
nothing calls this directly
no test coverage detected