package core:testing

Index

Constants (0)

This section is empty.

Variables (0)

This section is empty.

Procedure Groups (0)

This section is empty.

Types

Internal_Cleanup ¶

Internal_Cleanup :: struct {
	procedure: proc "odin" (ptr: rawptr),
	user_data: rawptr,
}

Internal_Test ¶

Internal_Test :: struct {
	pkg:  string,
	name: string,
	p:    Test_Signature,
}
 

IMPORTANT NOTE: Compiler requires this layout

T ¶

T :: struct {
	error_count: int,
	w:           io.Writer,
	cleanups:    [dynamic]Internal_Cleanup,
	_fail_now:   proc "odin" () -> !,
}

Test_Signature ¶

Test_Signature :: proc "odin" (_: ^T)
 

IMPORTANT NOTE: Compiler requires this layout

Constants

This section is empty.

Variables

This section is empty.

Procedures

cleanup ¶

cleanup :: proc "odin" (t: ^T, procedure: proc "odin" (ptr: rawptr), user_data: rawptr) {…}
 

cleanup registers a procedure and user_data, which will be called when the test, and all its subtests, complete cleanup proceduers will be called in LIFO (last added, first called) order.

error ¶

error :: proc "odin" (t: ^T, args: ..any, loc := #caller_location) {…}

errorf ¶

errorf :: proc "odin" (t: ^T, format: string, args: ..any, loc := #caller_location) {…}

expect ¶

expect :: proc "odin" (t: ^T, ok: bool, msg: string = "", loc := #caller_location) -> bool {…}

expect_value ¶

expect_value :: proc "odin" (t: ^T, value, expected: $, loc := #caller_location) -> bool {…}

fail ¶

fail :: proc "odin" (t: ^T, loc := #caller_location) {…}

fail_now ¶

fail_now :: proc "odin" (t: ^T, msg: string = "", loc := #caller_location) {…}

failed ¶

failed :: proc "odin" (t: ^T) -> bool {…}

log ¶

log :: proc "odin" (t: ^T, args: ..any, loc := #caller_location) {…}

logf ¶

logf :: proc "odin" (t: ^T, format: string, args: ..any, loc := #caller_location) {…}

set_fail_timeout ¶

set_fail_timeout :: proc "odin" (t: ^T, duration: time.Duration, loc := #caller_location) {…}

Procedure Groups

This section is empty.

Source Files

Generation Information

Generated with odin version dev-2022-10 (vendor "odin") Windows_amd64 @ 2022-10-05 21:11:47.523670600 +0000 UTC