ecoli_test(3)
π ecoli_test β Library Functions Manual π
okay bestie, welcome to the ecoli_test(3) page, straight out of the Library Functions Manual for Libecoli π«Ά this is the one about unit-test helpers, and yes it's giving extremely useful, no cap.
β¨ NAME β¨
ecoli_test β Test
- Helpers for unit tests. π§ͺ
πΈ SYNOPSIS πΈ
π Data Structures
struct ec_test
π Macros
#define EC_TEST_REGISTER(t)
#define EC_TEST_ERR(fmt, ...)
#define EC_TEST_CHECK(cond, fmt, ...)
#define EC_TEST_CHECK_PARSE(node, args...)
#define EC_TEST_CHECK_COMPLETE(node, args...)
#define EC_TEST_CHECK_COMPLETE_PARTIAL(node, args...)
π Typedefs
typedef int ec_test_t(void)
π Functions
int ec_test_register (struct ec_test *test)
int ec_test_all (void)
int ec_test_one (const char *name)
int ec_test_check_parse (struct ec_node *node, int expected,...)
int ec_test_check_complete (struct ec_node *node, enum ec_comp_type
type,...)
π¦ Detailed Description π¦
Helpers for unit tests. that's literally it, that's the whole vibe. π
π₯ Macro Definition Documentation π₯
#define EC_TEST_REGISTER( t)
Value:
static void ec_test_init_##t(void); \
static void __attribute__((constructor, used)) \
ec_test_init_##t(void) \
{ \
if (ec_test_register(&t) < 0) \
fprintf(stderr, "cannot register test %s\n", \
t.name); \
}
Register a test case. π
Parameters
tβ A pointer to aec_teststructure describing the test to be registered.
Definition at line 32 of file ecoli_test.h. π
#define EC_TEST_ERR( fmt, ...)
Value:
EC_LOG(EC_LOG_ERR, "%s:%d: error: " fmt "\n", \
__FILE__, __LINE__, ##__VA_ARGS__); \
Fail a test with a message. dramatic? yes. necessary? also yes π
Definition at line 105 of file ecoli_test.h. π
#define EC_TEST_CHECK( cond, fmt, ...)
Value:
({ \
int ret_ = 0; \
if (!(cond)) { \
EC_TEST_ERR("(" #cond ") is wrong. " fmt \
##__VA_ARGS__); \
ret_ = -1; \
} \
ret_; \
})
Verify a condition or fail a test with a message. main character energy fr π
Definition at line 114 of file ecoli_test.h. π
#define EC_TEST_CHECK_PARSE( node, args...)
Value:
({ \
int ret_ = ec_test_check_parse(node, args, EC_VA_END); \
if (ret_) \
EC_TEST_ERR("parse test failed"); \
ret_; \
})
node, input, [expected1, expected2, ...] β¨
Definition at line 129 of file ecoli_test.h. π
#define EC_TEST_CHECK_COMPLETE( node, args...)
Value:
({ \
int ret_ = ec_test_check_complete(node, EC_COMP_FULL, args); \
if (ret_) \
EC_TEST_ERR("complete test failed"); \
ret_; \
})
Definition at line 141 of file ecoli_test.h. π
#define EC_TEST_CHECK_COMPLETE_PARTIAL( node, args...)
Value:
({ \
int ret_ = ec_test_check_complete(node, EC_COMP_PARTIAL, args); \
if (ret_) \
EC_TEST_ERR("complete test failed"); \
ret_; \
})
Definition at line 149 of file ecoli_test.h. π
π Typedef Documentation π
typedef int ec_test_t(void)
Type of test function. Return 0 on success, -1 on error. π«Ά
Definition at line 47 of file ecoli_test.h. π
β Function Documentation β
int ec_test_register (struct ec_test * test)
Register a test case. π
int ec_test_all (void )
Run all tests. every single one, no skipping bestie π
int ec_test_one (const char * name)
Run one test. just the one, very demure π¦
int ec_test_check_parse (struct ec_node * node, int expected, ...)
expected == -1 means no match π
π Author π
Generated automatically by Doxygen for Libecoli from the source code. π€β¨
and that's the whole page bestie!! π this was Libecoli, Version 0.6.0 β ecoli_test(3), slay, periodt, go write some tests ππ«Άπ
π¦ where this page comes from
- fedora 43: libecoli-devel 0.6.0-1.fc43 Β· BSD-3-Clause AND LicenseRef-Fedora-Public-Domain
- fedora 43: libecoli-devel 0.6.0-1.fc43 Β· BSD-3-Clause AND LicenseRef-Fedora-Public-Domain
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms