{"id":20633289,"url":"https://github.com/zyga/libzt","last_synced_at":"2025-03-09T02:25:01.371Z","repository":{"id":50053243,"uuid":"233474714","full_name":"zyga/libzt","owner":"zyga","description":"libzt is a simple and robust unit test library for C","archived":false,"fork":false,"pushed_at":"2021-11-21T21:52:23.000Z","size":209,"stargazers_count":0,"open_issues_count":4,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-05T11:47:55.089Z","etag":null,"topics":["c","robust","testing","too"],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zyga.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}},"created_at":"2020-01-12T23:29:19.000Z","updated_at":"2021-06-05T11:20:01.000Z","dependencies_parsed_at":"2022-08-31T11:01:51.569Z","dependency_job_id":null,"html_url":"https://github.com/zyga/libzt","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zyga%2Flibzt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zyga%2Flibzt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zyga%2Flibzt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zyga%2Flibzt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zyga","download_url":"https://codeload.github.com/zyga/libzt/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242634102,"owners_count":20161268,"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","robust","testing","too"],"created_at":"2024-11-16T14:19:37.084Z","updated_at":"2025-03-09T02:25:01.351Z","avatar_url":"https://github.com/zyga.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"![C CI](https://github.com/zyga/libzt/workflows/C%20CI/badge.svg)\n\n# libzt is an unit test library for C\n\nlibzt is a simple and robust unit test library for C.\n\n## Features\n\n - Robust, allowing you to focus on your code.\n - Simple and small, making it quick to learn and use.\n - Doesn't use dynamic memory allocation, reducing error handling.\n - Equipped with useful helpers for writing test cases.\n - Portable and supported on Linux, MacOS, Windows and DOS.\n - Documented and fully coverage and integration tested.\n\n## Example\n\n```\n#include \u003cstdio.h\u003e\n#include \u003czt.h\u003e\n\nstatic const char *greeting(void) {\n  return \"hello there\";\n}\n\nstatic void test_smoke(zt_t t) {\n  zt_check(t, ZT_TRUE(2 + 2 == 4));\n  zt_check(t, ZT_CMP_INT(2 + 2, ==, 4));\n  zt_check(t, ZT_CMP_STR(greeting(), ==, \"hello there\"));\n}\n\nstatic void test_writing_to_tmpfile(zt_t t) {\n  FILE *f = tmpfile();\n  zt_assert(t, ZT_NOT_NULL(f)); // stops test on failure\n  zt_check(t, ZT_CMP_INT(fprintf(f, \"%s\", greeting()), \u003e, 0);\n  zt_check(t, ZT_CMP_INT(ftell(f), ==, strlen(greeting()));\n  zt_check(t, ZT_CMP_INT(fclose(f), ==, 0);\n}\n\nstatic void test_suite(zt_visitor v) {\n  ZT_VISIT_TEST(v, test_smoke);\n  ZT_VISIT_TEST(v, test_writing_to_tmpfile);\n}\n\nint main(int argc, char **argv, char **envp) {\n  return zt_main(argc, argv, envp, test_suite);\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzyga%2Flibzt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzyga%2Flibzt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzyga%2Flibzt/lists"}