{"id":42313186,"url":"https://github.com/rwypior/tinytest","last_synced_at":"2026-01-27T11:38:03.655Z","repository":{"id":231177998,"uuid":"435569671","full_name":"rwypior/tinytest","owner":"rwypior","description":"Tiny, header-only, unit testing library for C and C++","archived":false,"fork":false,"pushed_at":"2024-05-18T18:14:02.000Z","size":24,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-05-18T19:27:22.036Z","etag":null,"topics":["c","cpp","library","test","test-tools","testing","unit-test"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rwypior.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2021-12-06T16:32:59.000Z","updated_at":"2024-05-18T18:14:06.000Z","dependencies_parsed_at":"2024-04-02T21:51:06.227Z","dependency_job_id":null,"html_url":"https://github.com/rwypior/tinytest","commit_stats":null,"previous_names":["rwypior/tinytest"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rwypior/tinytest","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rwypior%2Ftinytest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rwypior%2Ftinytest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rwypior%2Ftinytest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rwypior%2Ftinytest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rwypior","download_url":"https://codeload.github.com/rwypior/tinytest/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rwypior%2Ftinytest/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28812495,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-27T07:41:26.337Z","status":"ssl_error","status_checked_at":"2026-01-27T07:41:08.776Z","response_time":168,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c","cpp","library","test","test-tools","testing","unit-test"],"created_at":"2026-01-27T11:38:03.593Z","updated_at":"2026-01-27T11:38:03.647Z","avatar_url":"https://github.com/rwypior.png","language":"C++","readme":"# TINY TEST FRAMEWORK\n\nTiny test framework is small, header-only unit testing framework for C and C++ languages.\nThe goal of this project is to share fast and easy way to test your projects.\n\n## Using the framework\n\nTo begin work with the framework, few steps has to be made:\n\n1. Copy file \"unittest.h\" from \"lib\" directory and include it in your project\n2. Call \"UNITTEST_INIT()\" macro once in your project in global scope\n3. Add UNITTEST definition to your project to enable the tests\n\nOnce above steps are complete, you may create and execute unit tests using set of test macros.\n\n## Test macros\n\nBelow are listed all testing macros this framework has to offer\n\nTest name                                                            | Description\n---------------------------------------------------------------------|-----------------\nUNITTEST_ASSERT_TRUE(STATEMENT)                                      | Tests if STATEMENT evaluates to truth.\nUNITTEST_ASSERT_FALSE(STATEMENT)                                     | Tests if STATEMENT evaluates to false.\nUNITTEST_ASSERT_FLOAT_EQUAL_EPS(STATEMENT, EXPECTED, EPS)            | Compares single or double precision floating point STATEMENT with floating point EXPECTED using specified epsilon value EPS\nUNITTEST_ASSERT_DOUBLE_EQUAL_EPS(STATEMENT, EXPECTED, EPS)           |\nUNITTEST_ASSERT_FLOAT_EQUAL(STATEMENT, EXPECTED)                     | Compares single or double precision floating point STATEMENT with floating point EXPECTED using default system epsilon value\nUNITTEST_ASSERT_DOUBLE_EQUAL(STATEMENT, EXPECTED)                    |\nUNITTEST_ASSERT_EQUAL(STATEMENT, EXPECTED)                           | Compares two values STATEMENT and EXPECTED using simple == operator. This is best suited to use with structures and objects.\nUNITTEST_ASSERT_INT_EQUAL(STATEMENT, EXPECTED)                       | Compares two values STATEMENT and EXPECTED using simple == operator and attempt to print their values upon failure as integers.\nUNITTEST_ASSERT_CSTR_EQUAL(STATEMENT, EXPECTED)                      | Compares two c-strings STATEMENT and EXPECTED\nUNITTEST_ASSERT_TIME_BEGIN()                                         | Begin time-based assertion block\nUNITTEST_ASSERT_TIME_NOTLONGER_END(MICROS)                           | Asserts that code executed between UNITTEST_ASSERT_TIME_BEGIN and UNITTEST_ASSERT_TIME_NOTLONGER_END macros took no longer than MICROS microseconds\nUNITTEST_ASSERT_TRAP_START(TRAPNAME)                                 | Begin trap-based assertion block and later assert that code between UNITTEST_ASSERT_TRAP_START and any of UNITTEST_ASSERT_TRAP_* macros hit specified trap TRAPNAME correct number of times\nUNITTEST_ASSERT_TRAP_HIT_END(TRAPNAME)                               | Trap must be hit any number of times\nUNITTEST_ASSERT_TRAP_NOT_HIT_END(TRAPNAME)                           | Trap must not be hit\nUNITTEST_ASSERT_TRAP_HIT_COUNT_END(TRAPNAME, HITCOUNT)               | Trap must be hit specified number of times\nUNITTEST_ASSERT_TRAP_HIT_MORE_END(TRAPNAME, HITCOUNT)                | Trap must be hit more than specified number of times\nUNITTEST_ASSERT_TRAP_HIT_LESS_END(TRAPNAME, HITCOUNT)                | Trap must be hit less than specified number of times\nUNITTEST_ASSERT_EXCEPTION_START                                      | Begin exception-based assertion block - this is only available when using C++ language\nUNITTEST_ASSERT_NOEXCEPTION_END                                      | Assert that no exception occurred between UNITTEST_ASSERT_EXCEPTION_START and UNITTEST_ASSERT_NOEXCEPTION_END macros\nUNITTEST_ASSERT_THROWEXCEPTION_END                                   | Assert that any exception occurred between UNITTEST_ASSERT_EXCEPTION_START and UNITTEST_ASSERT_THROWEXCEPTION_END macros\nUNITTEST_ASSERT_EXCEPTIONTYPE_END(TYPE)                              | Assert that an exception of TYPE type occurred between UNITTEST_ASSERT_EXCEPTION_START and UNITTEST_ASSERT_THROWEXCEPTION_END macros\n\n## Creating tests\n\nTests are created using a set of macros with syntax resembling function syntax. In order to create unit test, use UNITTEST_BEGIN(TESTNAME) macro, where TESTNAME will be name used to reference the test.\nInside the unit test function, testing code must be placed between UNITTEST_SETUP(); and UNITTEST_END(); macros.\n\nTest names must be unique throughout the entire project, and each file containing tests must include unittest.h file.\n\nExample test:\n\n    UNITTEST_BEGIN(multest)\n    {\n        UNITTEST_SETUP();\n\n        UNITTEST_ASSERT_EQUAL(mul(1.0, 5.0), 1.0 * 5.0);\n        UNITTEST_ASSERT_EQUAL(mul(2.0, 3.0), 2.0 * 3.0);\n        UNITTEST_ASSERT_EQUAL(mul(5.0, 7.0), 1.0);\n\n        UNITTEST_END();\n    }\n\n## Trap tests\n\nTraps are used to determine if a fragment of code was executed. In order to use trap tests, traps must be first defined using UNITTEST_TRAP_DEFINE(TRAPNAME) macro. Once trap is defined, it has to be linked \nin the file where testing function is present using UNITTEST_TRAP_LINK(TRAPNAME) macro and executed in desired line of code using UNITTEST_TRAP_ACTIVATE(TRAPNAME) macro.\n\n## Test execution\n\nIn order to execute tests, begin test execution block using UNITTEST_RUNBLOCK_BEGIN() and UNITTEST_RUNBLOCK_END() macros and place a set of UNITTEST_EXEC(TESTNAME) macros for each test that is needed to run \nwhere TESTNAME is name of the test specified in UNITTEST_BEGIN(TESTNAME) macro.\n\n## Examples\n\nFor more examples take a look at test_basic.h, test_exceptions.h, test_trap.h and tests.h files.\n\n## License\n\n[MIT](LICENSE)","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frwypior%2Ftinytest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frwypior%2Ftinytest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frwypior%2Ftinytest/lists"}