Core Library0.xAPI Reference

Choose documentation 3

latest

Current version

latest
English

Early release libtmux is released, and its APIs may still change between releases. This site's structure and URLs may change too.

function libtmux-go latest

Main

Main runs the one-call package lifecycle for tmuxtest. It prepares short temporary paths, redirects suiteEnvironment into them, clears the variables that select a server outside them, runs m, cleans registered servers, restores the environment, and returns the final status. It returns 2 without running m when the environment would still reach a server outside the suite.

Source and package
Qualified name
tmuxtest.Main
Package
tmuxtest
Distribution
github.com/libtmux/libtmux-go/tmux
Source
tmux/tmuxtest/harness.go
func Main(m *testing.M) int

Description#

After m returns, Main scans the whole suite root for sockets and stops each server still answering on one with kill-server. Such a server is a test's leak: Main reports how many it found, without naming a path, and returns 1 even when every test passed. The root is kept while a server still answers in it. TestMain should return its result through os.Exit.

Parameters
  • m (*testing.M) #

Guides#

Pages that discuss Main.

Esc

Type to search.

Reference previewOpen reference