package headless import ( "fmt" "os" "strings" "time" ) // fakeXcodebuild is the fake worker's xcodebuild (a copy of this test // binary named xcodebuild): it fails while Woodstar/Swipe.swift or // Pane.swift says false, printing the edit that fixes it, passes // otherwise, and hangs while a file named like it with ".hang" exists. func fakeXcodebuild() int { self, _ := os.Executable() if _, err := os.Stat(self + ".hang"); err == nil { fmt.Println("Testing started") time.Sleep(time.Hour) return 1 } fmt.Println("Test Suite 'All tests' started") for _, c := range [][2]string{{"Woodstar/Swipe.swift", "edgeSwipe"}, {"Woodstar/Pane.swift", "paneBack"}} { src, _ := os.ReadFile(c[0]) if strings.Contains(string(src), c[1]+" = false") { fmt.Printf("%s:1: error: XCTAssertTrue failed: %s is false. edit:%s|%s = false|%s = true\n", c[0], c[1], c[0], c[1], c[1]) if c[1] == "paneBack" { // The fix round says where it works and whether the // first round's uncommitted file is there (M9b). fmt.Println("note: probe:build/leftover.txt saycwd") } fmt.Println("** TEST FAILED **") return 65 } } fmt.Println("Test Suite 'All tests' passed.\n** TEST SUCCEEDED **") return 0 }