summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gmail.com>2023-03-17 11:29:29 +0000
committerEmmanuele Bassi <ebassi@gmail.com>2023-03-17 11:29:29 +0000
commite979fd9a157688a1a65fb58250b2a9fe94d14d50 (patch)
treeadca08ef06fb8a71873b41be58a07bf779f5efb6
parent98a567ce7fadfd5b5f69afdcf6265ad44494d1c5 (diff)
parent045bc7adde0caee68698159d915fdbdd4e98860c (diff)
downloadglib-e979fd9a157688a1a65fb58250b2a9fe94d14d50.tar.gz
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
-rw-r--r--glib/gtestutils.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/glib/gtestutils.c b/glib/gtestutils.c
index fcf1caff3..e98294ed3 100644
--- a/glib/gtestutils.c
+++ b/glib/gtestutils.c
@@ -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.