INNER CODE UNIT · Go

TestMain

xo/usql · cli_test.go:33

func TestMain(m *testing.M) {
	flag.Parse()
	code, err := runMain(m)
	if err != nil {
		fmt.Fprintf(os.Stderr, "error: %v\n", err)
		if code == 0 {
			code = 1
		}
	}
	os.Exit(code)
}

// runMain builds usql into a temporary directory and runs the tests.
func runMain(m *testing.M) (int, error) {
	if runtime.GOOS != "linux" && runtime.GOOS != "darwin" {
		// Nothing to build, because Record cannot run here. The tests
		// themselves report the skip, so that the reason is visible.
		return m.Run(), nil

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…