- public void add (string testpath, void* fixture, TestFixtureFunc fsetup, TestFixtureFunc ftest, TestFixtureFunc fteardown)
- public void add_data_func (string testpath, owned TestDataFunc test_funcvoid)
Create a new test case, similar to
TestCase.
- public void add_data_func_full (string testpath, owned TestDataFunc test_func)
Create a new test case, as with
add_data_func, but freeing test_data
after the test run is
complete.
- public void add_func (string testpath, owned TestFunc test_funcvoid)
Create a new test case, similar to
TestCase.
- public void assert_expected_messages ()
- public void bug (string bug_uri_snippet)
This function adds a message to test reports that associates a bug URI with
a test case.
- public void bug_base (string uri_pattern)
Specify the base URI for bug reports.
- public string build_filename (FileType file_type, string[] path_segments)
Creates the pathname to a data file that is required for a test.
- public void disable_crash_reporting ()
Attempt to disable system crash reporting infrastructure.
- public void expect_message (string? log_domain, LogLevelFlags log_level, string pattern)
Indicates that a message with the given log_domain
and
log_level
, with text matching pattern
, is expected to be logged.
- public void fail ()
Indicates that a test failed.
- public void fail_printf (string format, ...)
- public bool failed ()
Returns whether a test has already failed.
- public unowned string get_dir (FileType file_type)
Gets the pathname of the directory containing test files of the type
specified by file_type
.
- public unowned string get_filename (FileType file_type, string[] path_segments)
Gets the pathname to a data file that is required for a test.
- public unowned string get_path ()
Gets the test path for the test currently being run.
- public void incomplete (string? msg = null)
Indicates that a test failed because of some incomplete functionality.
- public void incomplete_printf (string format, ...)
- public void init (ref unowned string[] args, ...)
Initialize the GLib testing framework, e.
- public bool initialized ()
- public void log_set_fatal_handler (LogFatalFunc log_func)
Installs a non-error fatal log handler which can be used to decide whether
log messages which are counted as fatal abort the program.
- public void maximized_result (double maximized_quantity, string format, ...)
Report the result of a performance or measurement test.
- public void message (string format, ...)
Add a message to the test report.
- public void minimized_result (double minimized_quantity, string format, ...)
Report the result of a performance or measurement test.
- public bool perf ()
- public bool quick ()
- public bool quiet ()
- public bool rand_bit ()
- public double rand_double ()
Get a reproducible random floating point number, see
rand_int for details on test case random numbers.
- public double rand_double_range (double begin, double end)
Get a reproducible random floating pointer number out of a specified range,
see rand_int for details on test case random numbers.
- public int32 rand_int ()
Get a reproducible random integer number.
- public int32 rand_int_range (int32 begin, int32 end)
Get a reproducible random integer number out of a specified range, see
rand_int for details on test case random numbers.
- public int run ()
Runs all tests under the toplevel suite which can be retrieved with
get_root.
- public void set_nonfatal_assertions ()
Changes the behaviour of the various `g_assert_*()` macros,
assert_expected_messages and the various
`g_test_trap_assert_*()` macros to not abort to program, but instead call fail
and continue.
- public void skip (string? msg = null)
Indicates that a test was skipped.
- public void skip_printf (string format, ...)
Equivalent to skip
, but the explanation is formatted as if by to_string.
- public bool slow ()
- public bool subprocess ()
Returns true (after
init has been called) if the test program is running under
trap_subprocess.
- public void summary (string summary)
Set the summary for a test, which describes what the test checks, and how it
goes about checking it.
- public bool thorough ()
- public double timer_elapsed ()
Get the number of seconds since the last start of the timer with
timer_start.
- public double timer_last ()
- public void timer_start ()
Start a timing test.
- public void trap_assert_failed ()
- public void trap_assert_passed ()
- public void trap_assert_stderr (string serrpattern)
- public void trap_assert_stderr_unmatched (string serrpattern)
- public void trap_assert_stdout (string soutpattern)
- public void trap_assert_stdout_unmatched (string soutpattern)
- public bool trap_fork (uint64 usec_timeout, TestTrapFlags test_trap_flags)
Fork the current test program to execute a test case that might not return
or that might abort.
- public bool trap_has_passed ()
- public bool trap_reached_timeout ()
- public void trap_subprocess (string? test_path, uint64 usec_timeout, TestSubprocessFlags test_flags)
Respawns the test program to run only test_path
in a
subprocess.
- public bool verbose ()