{"id":18509964,"url":"https://github.com/zpl-c/tester","last_synced_at":"2025-10-15T00:27:31.600Z","repository":{"id":46283981,"uuid":"340403257","full_name":"zpl-c/tester","owner":"zpl-c","description":"🧪 A simple, minimalist tester for your minimalist needs","archived":false,"fork":false,"pushed_at":"2023-02-17T05:47:25.000Z","size":34,"stargazers_count":22,"open_issues_count":2,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-09T21:40:32.862Z","etag":null,"topics":["c99","no-dependencies","single-header","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":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zpl-c.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":"2021-02-19T15:01:56.000Z","updated_at":"2024-03-16T20:52:05.000Z","dependencies_parsed_at":"2024-11-06T15:31:16.741Z","dependency_job_id":null,"html_url":"https://github.com/zpl-c/tester","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/zpl-c/tester","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zpl-c%2Ftester","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zpl-c%2Ftester/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zpl-c%2Ftester/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zpl-c%2Ftester/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zpl-c","download_url":"https://codeload.github.com/zpl-c/tester/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zpl-c%2Ftester/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279032090,"owners_count":26089383,"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","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["c99","no-dependencies","single-header","unit-testing"],"created_at":"2024-11-06T15:19:51.648Z","updated_at":"2025-10-15T00:27:31.572Z","avatar_url":"https://github.com/zpl-c.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n    \u003ca href=\"https://github.com/zpl-c/zpl\"\u003e\u003cimg src=\"https://user-images.githubusercontent.com/2182108/111983468-d5593e80-8b12-11eb-9c59-8c78ecc0504e.png\" alt=\"zpl\" /\u003e\u003c/a\u003e\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n    \u003ca href=\"https://discord.gg/2fZVEym\"\u003e\u003cimg src=\"https://img.shields.io/discord/354670964400848898?color=7289DA\u0026style=for-the-badge\" alt=\"discord\" /\u003e\u003c/a\u003e\n\u003c/div\u003e\n\n\u003cbr /\u003e\n\u003cdiv align=\"center\"\u003e\n  A simple, minimalist tester for your minimalist needs\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \u003csub\u003e\n    Brought to you by \u003ca href=\"https://github.com/zpl-zak\"\u003e@zpl-zak\u003c/a\u003e,\n     \u003ca href=\"https://github.com/inlife\"\u003e@inlife\u003c/a\u003e,\n    and \u003cstrong\u003econtributors\u003c/strong\u003e\n  \u003c/sub\u003e\n\u003c/div\u003e\n\n# Introduction\nSimple to use library to easily cover your code with tests. No dependencies, no obscure or over-engineered pipeline, just a dead-simple framework.\nYou can easily make use of it, it looks pleasant (especially on CI flows), and it won't slow you down anyhow.\n## Who uses this library?\n\n* [zpl](https://github.com/zpl-c/zpl) - This is where the library has originated.\n* [librg](https://github.com/zpl-c/librg) - Making multi-player simpler since 2017. Single-header cross-platform world replication library in pure C99.\n\n# Features\n\n* Easy to use single-header framework\n* No dependencies (except the standard library :)\n* Works with C99 code\n* Integrates well within any CI pipeline\n* Supports the following checks: `FAIL`, `UFAIL`, `STRFAIL`, `EQUALS`, `UEQUALS`, `STREQUALS`, `STRCEQUALS`, `STRCNEQUALS`, `STRNEQUALS`, `NEQUALS`, `LESSER`, `GREATER`, `LESSEREQ`, `GREATEREQ`, `SKIP`\n* Did I mention it takes a minimum time to set up?\n\n# How to obtain the library?\n\n* Either clone the repository or download [unit.h](include/unit.h).\n* Include `unit.h` in your test app and cover your code already!\n\n# Example Usage\nAt first, we should define our entry point for the tester app:\n```c\n#define UNIT_MAX_MODULES 2\n#include \"unit.h\"\n\n/* TEST CATEGORIES */\n#include \"cases/some_math.h\"\n#include \"cases/cool_stuff.h\"\n\nint main() {\n    UNIT_CREATE(\"small\");\n\n    UNIT_MODULE(math);\n    UNIT_MODULE(cool_stuff);\n\n    return UNIT_RUN();\n}\n```\n\nAs you can see, this app defines 2 test modules called: `math` and `cool_stuff`, respectively.\n\nLet's explore them!\n\n[some_math.h](example/cases/some_math.h)\n```c\n#include \u003cmath.h\u003e\n\nMODULE(math, {\n    IT(\"can do cos(0)\", {\n        EQUALS(cosf(0), 1);\n    });\n\n    IT(\"can do sqrt(9)\", {\n        EQUALS(sqrtf(9), 3);\n    });\n});\n```\n\n[cool_stuff.h](example/cases/cool_stuff.h)\n```c\nMODULE(cool_stuff, {\n    IT(\"can predict the future\", {\n        // Not today ...\n        SKIP();\n    });\n});\n```\n\nAs you can see, this is all it takes to cover your code, relatively simple, right?\nYou can also skip tests you plan on running later in the future (or never :)\n\nHave fun!\n\n![result](https://user-images.githubusercontent.com/9026786/108531043-8bdcc000-72d6-11eb-9a33-4092411a57bd.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzpl-c%2Ftester","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzpl-c%2Ftester","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzpl-c%2Ftester/lists"}