pmtesting

package
v1.6.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 11, 2024 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

Package pmtesting provides a simple unit test setup routine.

Usage:

package name

import (
	"testing"

	"github.com/safing/portmaster/core/pmtesting"
)

func TestMain(m *testing.M) {
	pmtesting.TestMain(m, module)
}

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TestMain

func TestMain(m *testing.M, module *modules.Module)

TestMain provides a simple unit test setup routine.

func TestMainWithHooks

func TestMainWithHooks(m *testing.M, module *modules.Module, afterStartFn, beforeStopFn TestHookFunc)

TestMainWithHooks provides a simple unit test setup routine and calls afterStartFn after modules have started and beforeStopFn before modules are shutdown.

Types

type TestHookFunc

type TestHookFunc func() error

TestHookFunc describes the functions passed to TestMainWithHooks.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL