{"id":16179515,"url":"https://github.com/stavshamir/test_utils","last_synced_at":"2025-04-07T11:44:10.413Z","repository":{"id":117560587,"uuid":"150390553","full_name":"stavshamir/test_utils","owner":"stavshamir","description":"A simple unit testing framework for C99","archived":false,"fork":false,"pushed_at":"2018-09-26T08:21:03.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-13T14:31:57.516Z","etag":null,"topics":["c","c99","unit-test","unit-testing","unit-testing-framework","unittest","unittesting","unittests"],"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/stavshamir.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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,"publiccode":null,"codemeta":null}},"created_at":"2018-09-26T08:03:19.000Z","updated_at":"2018-09-26T08:37:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"261edfe6-4800-4b52-abcb-d61360743bdd","html_url":"https://github.com/stavshamir/test_utils","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stavshamir%2Ftest_utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stavshamir%2Ftest_utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stavshamir%2Ftest_utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stavshamir%2Ftest_utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stavshamir","download_url":"https://codeload.github.com/stavshamir/test_utils/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247648926,"owners_count":20972942,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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","c99","unit-test","unit-testing","unit-testing-framework","unittest","unittesting","unittests"],"created_at":"2024-10-10T05:28:43.743Z","updated_at":"2025-04-07T11:44:10.372Z","avatar_url":"https://github.com/stavshamir.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# test_utils\nA simple unit testing framework for C99.\n\n## Usage\nClone and run the following command:\n\n```bash\n$ source test_utils.sh \u003ctest_filename\u003e\n```\nThis will create a skeleton for your unit test file with the name test_filename.c:\n\n```C\n#include \u003cstdio.h\u003e\n\n#include \"test_filename.h\"\n\nvoid test_foo();\n\n/**********************************************************************************************************************/\n\nint main() {\n    test_fn_t tests[] = {\n            test_foo\n    };\n\n    RUN_TESTS(tests);\n\n    return 0;\n}\n\n/**********************************************************************************************************************/\n\nvoid test_foo() {\n    PRINT_TEST_HEADER;\n\n    FAIL_TEST();\n}\n```\n\nIn order to add a test function, do the following:\n1. Declare it above the main function\n2. Add the unit test function name to the tests array in the main function\n3. Implement the function, and optionally (but recommended) add the PRINT_TEST_HEADER macro as the first statment\n\n**All unit test functions must be void and receive no parameters.**\n\nLook at test_utils.h to see the available assertions (feel free to open an issue to add more assertions), and look at the test_example.c file for some more examples.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstavshamir%2Ftest_utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstavshamir%2Ftest_utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstavshamir%2Ftest_utils/lists"}