mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-04-23 15:49:16 +02:00
Merge branch 'testutils-docs' into 'main'
testutils: Documentation improvements See merge request GNOME/glib!4401
This commit is contained in:
commit
3dffcd2569
File diff suppressed because it is too large
Load Diff
@ -304,29 +304,31 @@ void g_test_init (int *argc,
|
|||||||
*
|
*
|
||||||
* A value that can be passed as an option to [func@GLib.test_init].
|
* A value that can be passed as an option to [func@GLib.test_init].
|
||||||
*
|
*
|
||||||
* Creates a unique temporary directory for each unit test and uses
|
* Creates a unique temporary directory for each unit test and uses sets
|
||||||
* g_set_user_dirs() to set XDG directories to point into subdirectories of it
|
* XDG directories to point into subdirectories of it for the duration of
|
||||||
* for the duration of the unit test. The directory tree is cleaned up after the
|
* the unit test. The directory tree is cleaned up after the test finishes
|
||||||
* test finishes successfully. Note that this doesn’t take effect until
|
* successfully.
|
||||||
* g_test_run() is called, so calls to (for example) g_get_user_home_dir() will
|
*
|
||||||
* return the system-wide value when made in a test program’s main() function.
|
* Note that this doesn’t take effect until [func@GLib.test_run] is called,
|
||||||
|
* so calls to (for example) [func@GLib.get_home_dir] will return the
|
||||||
|
* system-wide value when made in a test program’s main() function.
|
||||||
*
|
*
|
||||||
* The following functions will return subdirectories of the temporary directory
|
* The following functions will return subdirectories of the temporary directory
|
||||||
* when this option is used. The specific subdirectory paths in use are not
|
* when this option is used. The specific subdirectory paths in use are not
|
||||||
* guaranteed to be stable API — always use a getter function to retrieve them.
|
* guaranteed to be stable API — always use a getter function to retrieve them.
|
||||||
*
|
*
|
||||||
* - g_get_home_dir()
|
* - [func@GLib.get_home_dir]
|
||||||
* - g_get_user_cache_dir()
|
* - [func@GLib.get_user_cache_dir]
|
||||||
* - g_get_system_config_dirs()
|
* - [func@GLib.get_system_config_dirs]
|
||||||
* - g_get_user_config_dir()
|
* - [func@GLib.get_user_config_dir]
|
||||||
* - g_get_system_data_dirs()
|
* - [func@GLib.get_system_data_dirs]
|
||||||
* - g_get_user_data_dir()
|
* - [func@GLib.get_user_data_dir]
|
||||||
* - g_get_user_state_dir()
|
* - [func@GLib.get_user_state_dir]
|
||||||
* - g_get_user_runtime_dir()
|
* - [func@GLib.get_user_runtime_dir]
|
||||||
*
|
*
|
||||||
* The subdirectories may not be created by the test harness; as with normal
|
* The subdirectories may not be created by the test harness; as with normal
|
||||||
* calls to functions like g_get_user_cache_dir(), the caller must be prepared
|
* calls to functions like [func@GLib.get_user_cache_dir], the caller must
|
||||||
* to create the directory if it doesn’t exist.
|
* be prepared to create the directory if it doesn’t exist.
|
||||||
*
|
*
|
||||||
* Since: 2.60
|
* Since: 2.60
|
||||||
*/
|
*/
|
||||||
@ -437,20 +439,24 @@ void g_test_disable_crash_reporting (void);
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* g_test_add:
|
* g_test_add:
|
||||||
* @testpath: The test path for a new test case.
|
* @testpath: the test path for a new test case
|
||||||
* @Fixture: The type of a fixture data structure.
|
* @Fixture: the type of a fixture data structure
|
||||||
* @tdata: Data argument for the test functions.
|
* @tdata: data argument for the test functions
|
||||||
* @fsetup: The function to set up the fixture data.
|
* @fsetup: the function to set up the fixture data
|
||||||
* @ftest: The actual test function.
|
* @ftest: the actual test function
|
||||||
* @fteardown: The function to tear down the fixture data.
|
* @fteardown: the function to tear down the fixture data
|
||||||
*
|
*
|
||||||
* Hook up a new test case at @testpath, similar to g_test_add_func().
|
* Hooks up a new test case at @testpath.
|
||||||
* A fixture data structure with setup and teardown functions may be provided,
|
|
||||||
* similar to g_test_create_case().
|
|
||||||
*
|
*
|
||||||
* g_test_add() is implemented as a macro, so that the fsetup(), ftest() and
|
* This function is similar to [func@GLib.test_add_func].
|
||||||
* fteardown() callbacks can expect a @Fixture pointer as their first argument
|
*
|
||||||
* in a type safe manner. They otherwise have type #GTestFixtureFunc.
|
* A fixture data structure with setup and teardown functions
|
||||||
|
* may be provided, similar to [func@GLib.test_create_case].
|
||||||
|
*
|
||||||
|
* `g_test_add()` is implemented as a macro, so that the @fsetup,
|
||||||
|
* @ftest and @fteardown callbacks can expect a @Fixture pointer
|
||||||
|
* as their first argument in a type safe manner. They otherwise
|
||||||
|
* have type `GTestFixtureFunc`.
|
||||||
*
|
*
|
||||||
* Since: 2.16
|
* Since: 2.16
|
||||||
*/
|
*/
|
||||||
@ -507,12 +513,13 @@ void g_test_queue_destroy (GDestroyNotify destroy_func,
|
|||||||
* child process is shared with stdin of its parent process.
|
* child process is shared with stdin of its parent process.
|
||||||
* It is redirected to `/dev/null` otherwise.
|
* It is redirected to `/dev/null` otherwise.
|
||||||
*
|
*
|
||||||
* Test traps are guards around forked tests.
|
* Flags to pass to [func@GLib.test_trap_fork] to control input and output.
|
||||||
* These flags determine what traps to set.
|
|
||||||
*
|
*
|
||||||
* Deprecated: 2.38: #GTestTrapFlags is used only with g_test_trap_fork(),
|
* Test traps are guards around forked tests. These flags determine what traps to set.
|
||||||
* which is deprecated. g_test_trap_subprocess() uses
|
*
|
||||||
* #GTestSubprocessFlags.
|
* Deprecated: 2.38: `GTestTrapFlags` is used only with [func@GLib.test_trap_fork],
|
||||||
|
* which is deprecated. Its replacement, [func@GLib.test_trap_subprocess] uses
|
||||||
|
* [flags@GLib.TestSubprocessFlags].
|
||||||
*/
|
*/
|
||||||
typedef enum {
|
typedef enum {
|
||||||
G_TEST_TRAP_DEFAULT GLIB_AVAILABLE_ENUMERATOR_IN_2_74 = 0,
|
G_TEST_TRAP_DEFAULT GLIB_AVAILABLE_ENUMERATOR_IN_2_74 = 0,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user