Function

GLib-2.0GLibtest_add_data_funcSince 2.16

  • Creates a new test case.

    This function is similar to GLib.test_create_case. However the test is assumed to use no fixture, and test suites are automatically created on the fly and added to the root fixture, based on the /-separated portions of testpath. The test_data argument will be passed as first argument to test_func.

    If testpath includes the component "subprocess" anywhere in it, the test will be skipped by default, and only run if explicitly required via the -p command-line option or GLib.test_trap_subprocess.

    No component of testpath may start with a dot (.) if the GLib.TEST_OPTION_ISOLATE_DIRS option is being used; and it is recommended to do so even if it isn’t.

    Parameters

    • testpath: string

      a /-separated name for the test

    • test_data: any

      data for the test_func

    • test_func: TestDataFunc

      the test function to invoke for this test

    Returns void

    2.16