Documentation ¶
Overview ¶
Package crash contains functionality shared by tests that exercise the crash reporter.
Index ¶
- Constants
- func CheckCrashingProcess(ctx context.Context, cr *chrome.Chrome, opts CrasherOptions) error
- func CleanCrashSpoolDirs(ctx context.Context, crasherPath string) error
- func RunCrashTest(ctx context.Context, cr *chrome.Chrome, s *testing.State, ...) error
- type CrasherOptions
- type CrasherResult
Constants ¶
const (
// CrasherPath is the full path for crasher.
CrasherPath = "/usr/local/libexec/tast/helpers/local/cros/platform.UserCrash.crasher"
)
Variables ¶
This section is empty.
Functions ¶
func CheckCrashingProcess ¶
CheckCrashingProcess runs crasher process and verifies that it's processed.
func CleanCrashSpoolDirs ¶
CleanCrashSpoolDirs removes all crash files in the crash spool directories, produced artificially but not consumed during a test.
Types ¶
type CrasherOptions ¶
type CrasherOptions struct { Username string CauseCrash bool Consent bool CrasherPath string ExpectCrashReporterFail bool }
CrasherOptions stores configurations for running crasher process.
func DefaultCrasherOptions ¶
func DefaultCrasherOptions() CrasherOptions
DefaultCrasherOptions creates a CrasherOptions which actually cause and catch crash. Username is not populated as it should be set explicitly by each test.
type CrasherResult ¶
type CrasherResult struct { // ReturnCode is the return code of the crasher process. ReturnCode int // Crashed stores whether the crasher returned segv error code. Crashed bool // CrashReporterCaught stores whether the crash reporter caught a segv. CrashReporterCaught bool // Minidump (.dmp) crash report filename. Minidump string // Basename of the crash report files. Basename string // .meta crash report filename. Meta string // .log crash report filename. Log string // .pslog crash report filename (optional; only for crash reporter failures) Pslog string }
CrasherResult stores result status and outputs from a crasher process execution.
func RunCrasherProcess ¶
func RunCrasherProcess(ctx context.Context, cr *chrome.Chrome, opts CrasherOptions) (*CrasherResult, error)
RunCrasherProcess runs the crasher process. Will wait up to 10 seconds for crash_reporter to finish.
func RunCrasherProcessAndAnalyze ¶
func RunCrasherProcessAndAnalyze(ctx context.Context, cr *chrome.Chrome, opts CrasherOptions) (*CrasherResult, error)
RunCrasherProcessAndAnalyze executes a crasher process and extracts result data from dumps and logs.