Merge branch '2943-g-test-init-docs' into 'main'

gtestutils: Clarify docs about calling g_test_init() before anything

Closes #2943

See merge request GNOME/glib!3327
This commit is contained in:
Emmanuele Bassi 2023-03-17 11:29:29 +00:00
commit e979fd9a15

View File

@ -89,11 +89,15 @@
* The API is designed to handle creation and registration of test suites
* and test cases implicitly. A simple call like
* |[<!-- language="C" -->
* g_test_init (&argc, &argv, G_TEST_OPTION_ISOLATE_DIRS, NULL);
*
* g_test_add_func ("/misc/assertions", test_assertions);
* ]|
* creates a test suite called "misc" with a single test case named
* "assertions", which consists of running the test_assertions function.
*
* g_test_init() should be called before calling any other test functions.
*
* In addition to the traditional g_assert_true(), the test framework provides
* an extended set of assertions for comparisons: g_assert_cmpfloat(),
* g_assert_cmpfloat_with_epsilon(), g_assert_cmpint(), g_assert_cmpuint(),
@ -1684,6 +1688,8 @@ test_rm_isolate_dirs (void)
* test random number generator, the name for g_get_prgname()
* and parsing test related command line args.
*
* This should be called before calling any other `g_test_*()` functions.
*
* So far, the following arguments are understood:
*
* - `-l`: List test cases available in a test executable.