backlighttest

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: MIT, MIT Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package backlighttest fakes the sysfs backlight class directory for tests of code that reads or writes backlights.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(t testing.TB, name string, d Device)

Add puts one more device into the faked tree.

func Fake

func Fake(t testing.TB, devices map[string]Device) string

Fake points backlight.Dir at a temporary tree holding devices for the test's lifetime, and returns the tree. Tests that use it must not run in parallel.

func SetLevel

func SetLevel(t testing.TB, name string, level uint32)

SetLevel writes a device's brightness attribute as the kernel would after a change.

Types

type Device

type Device struct {
	Type       string
	Brightness uint32
	Max        uint32
}

Device is one fake backlight: its sysfs type attribute, level and maximum.

Jump to

Keyboard shortcuts

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