{"id":18576877,"url":"https://github.com/urin/miniunit","last_synced_at":"2025-04-10T09:30:40.455Z","repository":{"id":151727376,"uuid":"107870681","full_name":"urin/miniunit","owner":"urin","description":"Minimal unit testing framework for pure-C","archived":false,"fork":false,"pushed_at":"2020-04-29T14:40:05.000Z","size":8,"stargazers_count":12,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T19:08:20.595Z","etag":null,"topics":["c","unit-testing"],"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/urin.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,"publiccode":null,"codemeta":null}},"created_at":"2017-10-22T13:58:52.000Z","updated_at":"2023-12-15T00:10:28.000Z","dependencies_parsed_at":null,"dependency_job_id":"ccba871b-76d6-464c-ad17-3add9cd9f0db","html_url":"https://github.com/urin/miniunit","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/urin%2Fminiunit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/urin%2Fminiunit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/urin%2Fminiunit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/urin%2Fminiunit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/urin","download_url":"https://codeload.github.com/urin/miniunit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248191619,"owners_count":21062538,"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","unit-testing"],"created_at":"2024-11-06T23:26:58.561Z","updated_at":"2025-04-10T09:30:40.446Z","avatar_url":"https://github.com/urin.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# miniunit.h\n\nminiunit.h is a unit testing framework for pure-C. It features a simple interface for defining unit tests, putting little in the way of the developer.\n\n- header-file only\n- no external dependencies (only uses standard C libraries)\n\n## Usage\n\nDefine `MINIUNIT_MAIN` before including `miniunit.h` on the main source file.\n\n```c\n#define MINIUNIT_MAIN\n#include \"miniunit.h\"\n```\n\nJust include `miniunit.h` without defining `MINIUNIT_MAIN` on other source files.\n\n```c\n#include \"miniunit.h\"\n```\n\n### Example\n\n```c\n#define MINIUNIT_MAIN\n#include \"miniunit.h\"\n\nint main()\n{\n    test_case(\"Addition\", {\n        expect(\"1 + 1 = 2\", (1 + 1) == 2);\n        expect(\"1 + 1 + 1 = 3\", (1 + 1 + 1) == 3);\n    });\n\n    test_case(\"Subtraction\", {\n        expect(\"1 - 1 = 0\", (1 - 1) == 0);\n        expect(\"1 - 1 - 1 = -1\", (1 - 1 - 1) == -1);\n        expect(\"example\", true == false);\n    });\n\n    return 0;\n}\n```\n\noutputs\n\n```\n(1) Addition\n  (1-1) [Passed] 1 + 1 = 2\n  (1-2) [Passed] 1 + 1 + 1 = 3\n  Elapsed time 0.001451 sec\n(2) Subtraction\n  (2-1) [Passed] 1 - 1 = 0\n  (2-2) [Passed] 1 - 1 - 1 = -1\n  (2-3) [Failed] example (true == false) [main.c:15]\n```\n\n## License\n\n[MIT](/LICENSE)\n\n## Author\n\n[urin](//github.com/urin)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Furin%2Fminiunit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Furin%2Fminiunit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Furin%2Fminiunit/lists"}