Wren a web browser where WebAssembly runs everything, JavaScript included

Module testhost

What a page of a test program tells that program: its tests, their checks, what it measures, what it wants done to it. For test programs only (src/tools/testhost): the global wrenTest that calls these exists only in a page that has been given a test host (page.set_test_host), and without one they do nothing. A browser never gives one.

Exposed to: Window. Source: api/testhost.widl.

Odin: import "wren:testhost".

Types

enum TestSkipReason : i32

Why something a test needs cannot run on this machine. The test host decides whether that is true.

membervalue
WebglAdapter0
Av1Decoder1

Functions

TestHost_testBegin

void TestHost_testBegin(usvstring name)

A test of the section begins.

Odin: testhost.testBegin.

Host: TestHost_testBegin :: proc(c: ^Call, name: string)

TestHost_testEnd

void TestHost_testEnd(usvstring name)

The test ends.

Odin: testhost.testEnd.

Host: TestHost_testEnd :: proc(c: ^Call, name: string)

TestHost_check

void TestHost_check(bool passed, usvstring what)

One check and its result.

Odin: testhost.check.

Host: TestHost_check :: proc(c: ^Call, passed: bool, what: string)

TestHost_measure

void TestHost_measure(usvstring name, f64 value)

A value the section measured.

Odin: testhost.measure.

Host: TestHost_measure :: proc(c: ^Call, name: string, value: f64)

TestHost_note

void TestHost_note(usvstring text)

Something the program may wait for or read ("LISTENING").

Odin: testhost.note.

Host: TestHost_note :: proc(c: ^Call, text: string)

TestHost_signal

void TestHost_signal(usvstring name)

The script asks the program to act on the page, and waits (the program resumes it).

Odin: testhost.signal.

Host: TestHost_signal :: proc(c: ^Call, name: string)

TestHost_skip

void TestHost_skip(TestSkipReason reason, usvstring why)

The current test, or with no test open the whole section, does not run on this machine.

Odin: testhost.skip.

Host: TestHost_skip :: proc(c: ^Call, reason: Api_TestSkipReason, why: string)

TestHost_done

void TestHost_done()

The section is over.

Odin: testhost.done.

Host: TestHost_done :: proc(c: ^Call)

Edit this page on GitHub