Skip to content
This repository has been archived by the owner on May 19, 2021. It is now read-only.

GroupsCB

Maxime ROUFFET edited this page Mar 1, 2021 · 9 revisions

GroupBeginCB(_name)

GroupBeginCB is the callback called on group begin.

It can be simply set through UTH::GroupBeginCB and has for arguments:

  • const std::string& _name: The name of the group that begins.

GroupBeginCB is called either by using UTH_GROUP_BEGIN(name) or UTH_GROUP_TEST(func)

void MyGroupBeginCB(const std::string& _name);

void GroupTest1();

int main()
{
    SA_UTH_INIT();

    // Set callback.
    UTH::GroupBeginCB = MyGroupBeginCB;

    SA_UTH_GPB(ManualGroupTest1);
    SA_UTH_GPE();

    SA_UTH_GP(GroupTest1());

    SA_UTH_EXIT();
}

UTH::GroupBeginCB will be called first with the values:

  • _name: "ManualGroupTest1"

And in second with the values:

  • _name: "GroupTest1()"

GroupEndCB(_group)

GroupEndCB is the callback called on group end.

It can be simply set through UTH::GroupEndCB and has for arguments:

  • const Group& _group: The group that ends.

GroupEndCB is called either by using UTH_GROUP_END() or UTH_GROUP_TEST(func)

void MyGroupEndCB(const Group& _group);

void GroupTest1();

int main()
{
    SA_UTH_INIT();

    // Set callback.
    UTH::GroupEndCB = MyGroupEndCB;

    SA_UTH_GPB(ManualGroupTest1);
    SA_UTH_GPE();

    SA_UTH_GP(GroupTest1());

    SA_UTH_EXIT();
}

UTH::GroupEndCB will be called first with the values:

  • _group
    • name: "ManualGroupTest1"
    • localExit: true/false

And in second with the values:

  • _group
    • name: "GroupTest1()"
    • localExit: true/false

More Examples

See main_callbacks.cpp for examples of use.