MCPcopy Create free account
hub / github.com/WendellCraft/ModpackDebuggerKit / waitForTestResult

Method waitForTestResult

debug.go:322–357  ·  view source on GitHub ↗
(modCount int)

Source from the content-addressed store, hash-verified

320}
321
322func (a *App) waitForTestResult(modCount int) bool {
323 if a.AutoLaunchGame {
324 prismPath, err := findPrismLauncher()
325 if err != nil {
326 a.emitLog(fmt.Sprintf("Failed to launch Prism Launcher: %v", err), LogError)
327 wailsRuntime.EventsEmit(a.ctx, "test-group-prompt", map[string]interface{}{
328 "count": modCount,
329 "auto_launch": false,
330 })
331 result := <-a.testResultChan
332 return result
333 }
334 instanceName := a.getInstanceName()
335 cmd := exec.Command(prismPath, "-l", instanceName)
336 if err := cmd.Start(); err != nil {
337 a.emitLog(fmt.Sprintf("Failed to launch Prism Launcher: %v", err), LogError)
338 wailsRuntime.EventsEmit(a.ctx, "test-group-prompt", map[string]interface{}{
339 "count": modCount,
340 "auto_launch": false,
341 })
342 result := <-a.testResultChan
343 return result
344 }
345 defer func() {
346 cmd.Process.Kill()
347 time.Sleep(500 * time.Millisecond)
348 }()
349 }
350
351 wailsRuntime.EventsEmit(a.ctx, "test-group-prompt", map[string]interface{}{
352 "count": modCount,
353 "auto_launch": a.AutoLaunchGame,
354 })
355 result := <-a.testResultChan
356 return result
357}
358
359func (a *App) getInstanceName() string {
360 return filepath.Base(filepath.Dir(filepath.Dir(a.ProjectData.ModsDir)))

Callers 1

testGroupMethod · 0.95

Calls 3

emitLogMethod · 0.95
getInstanceNameMethod · 0.95
findPrismLauncherFunction · 0.85

Tested by

no test coverage detected