GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
SHTK_UNITTEST_ADD_FIXTURE(3) FreeBSD Library Functions Manual SHTK_UNITTEST_ADD_FIXTURE(3)

shtk_unittest_add_fixture
Defines a test fixture

shtk_import unittest

shtk_unittest_add_fixture name

The shtk_unittest_add_fixture function registers the fixture given by name. A function named ‘<name>_fixture’ must be defined after the call to shtk_unittest_add_fixture has been made.

Fixture functions must not directly contain any code. All they can do is define other functions, such as setup and teardown, and execute calls to shtk_unittest_add_test(3).

The following piece of code illustrates the components of a test fixture:
shtk_unittest_add_fixture my_collection
my_collection_fixture() {
    setup() {
        ... optional function providing per-test setup code ...
    }

    teardown() {
        ... optional function providing per-test teardown code ...
    }

    shtk_unittest_add_test first_scenario
    first_scenario_test() {
        ... test code for the first test case ...
    }

    shtk_unittest_add_test second_scenario
    second_scenario_test() {
        ... test code for the second test case ...
    }
}

shtk(3), shtk_unittest(3)

shtk_unittest_add_fixture first appeared in shtk 1.6.
November 8, 2014 FreeBSD 13.1-RELEASE

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.