Skip to content

Support for sub-suites#11

Draft
metafates wants to merge 3 commits into
mainfrom
sub-suites
Draft

Support for sub-suites#11
metafates wants to merge 3 commits into
mainfrom
sub-suites

Conversation

@metafates
Copy link
Copy Markdown
Member

This PR adds support for running sub-suites from Testo suites.

Example:

type T = *testo.T

type OuterSuite struct{ testo.Suite[T] }

func (OuterSuite) Test(t T) { testo.RunSubSuite(t, new(InnerSuite)) }

type InnerSuite struct{ testo.Suite[T] }

func (InnerSuite) Test(t T) { t.Log("Hello from sub-suite!") }

How it works with plugins

New reflection field is now available:

// SuiteInfo is the information about suite.
type SuiteInfo struct {
	// Parent refers to the parent suite info.
	// Non-nil value means that current suite is sub-suite.
	Parent *SuiteInfo

	...
}

Plugins can use it. But actual test levels remain the same, levels are not shared between suites. E.g. level 1 for top level test is also 1 for sub-suite's top-level tests

@metafates metafates self-assigned this May 20, 2026
@metafates metafates added the enhancement New feature or request label May 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant