{"id":16986592,"url":"https://github.com/eliasku/unit","last_synced_at":"2025-04-12T03:34:05.085Z","repository":{"id":38368909,"uuid":"492177027","full_name":"eliasku/unit","owner":"eliasku","description":"Tiny unit testing library for C language","archived":false,"fork":false,"pushed_at":"2022-06-07T13:50:21.000Z","size":1746,"stargazers_count":7,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-25T23:12:24.697Z","etag":null,"topics":["assertions","bdd","c","clang","cmake","cross-platform","embedded","header-only","kiss","single-header-library","small-projects","testing","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/eliasku.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2022-05-14T10:00:42.000Z","updated_at":"2023-11-26T11:16:12.000Z","dependencies_parsed_at":"2022-09-10T15:01:35.201Z","dependency_job_id":null,"html_url":"https://github.com/eliasku/unit","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eliasku%2Funit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eliasku%2Funit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eliasku%2Funit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eliasku%2Funit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eliasku","download_url":"https://codeload.github.com/eliasku/unit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248290465,"owners_count":21078993,"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":["assertions","bdd","c","clang","cmake","cross-platform","embedded","header-only","kiss","single-header-library","small-projects","testing","unit-testing"],"created_at":"2024-10-14T02:46:20.738Z","updated_at":"2025-04-12T03:34:05.065Z","avatar_url":"https://github.com/eliasku.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# unit\n\n[![Build](https://github.com/eliasku/unit/actions/workflows/build.yml/badge.svg)](https://github.com/eliasku/unit/actions/workflows/build.yml)\n[![codecov](https://codecov.io/gh/eliasku/unit/branch/master/graph/badge.svg?token=NFTrtCHQ2r)](https://codecov.io/gh/eliasku/unit)\n\n## 🥼 Tiny unit testing library for C language 🥼\n\n[![Standard](https://img.shields.io/badge/C-11-pink.svg)](https://en.wikipedia.org/wiki/C_(programming_language))\n[![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n[![Download](https://img.shields.io/badge/Download%20%20-unit.h-lightgreen.svg)](https://raw.githubusercontent.com/eliasku/unit/master/include/unit.h)\n[![Documentation](https://img.shields.io/badge/docs-latest-white)](http://unit.rtfd.io/)\n[![Twitter](https://img.shields.io/twitter/follow/eliaskuvoice.svg?style=flat\u0026label=Follow\u0026logoColor=white\u0026color=1da1f2\u0026logo=twitter)](https://twitter.com/eliaskuvoice)\n[![Try it online](https://img.shields.io/badge/Try%20it-online-orange.svg)](https://godbolt.org/z/17vjqsnca)\n\n![output](docs/output.gif)\n\n## Example\n\nCompile executable with `-D UNIT_TESTING` to enable tests\n\n```c\n#define UNIT_MAIN\n#include \u003cunit.h\u003e\n\nSUITE( suite name ) {\n  DESCRIBE( subcase name ) {\n    IT(\"is test behaviour\") {\n      WARN(\"use WARN_* to print failed assumptions\");\n      CHECK(\"use CHECK_* to continue execute assertions on fail\");\n      REQUIRE(\"use REQUIRE_* to skip next assertions on fail\");\n    }\n  }\n}\n\n```\n\n## Command-line options\n\n- `--version`, `-v`: Prints the version of `unit` library\n- `--help`, `-h`: Prints usage help message\n- `--list`, `-l`: Prints all available tests\n- `--animate`, `-a`: Simulate waits for printing messages, just for making fancy printing animation\n- `--ascii`: Don't use colors and fancy unicode symbols in the output\n- `--short-filenames`, `-S`: Use only basename for displaying file-pos information\n- `--quiet`, `-q`: Disables all output\n- `-r=xml`: Special switch prints XML report in DocTest-friendly format (for CLion test run configuration)\n\n## Features and design goals\n\n### ✓ Main focus and features\n\n- Written in Pure C: only standard `libc` is used\n- Simplicity and tiny build-size\n- No dynamic memory allocations: only static memory is used for reporting test running infrastructure.\n- Single-header library: easy to integrate\n- Embedded runner \u0026 pretty reporter: build self-executable test\n- Disable test code: allow you to write tests for your private implementation right at the end of `impl.c` file\n- Cross-platform: should work for Linux / macOS / Windows / WebAssembly\n\n### ✕ What you won't find here\n\n- Cross-compiler support: no `MSVC` support, only `clang` is tested\n- Multithreading and parallel test running\n- Tricky test matchers design\n- Fixtures, `before` / `after` or mocking\n- Crash tests and signal interception\n- Fuzz testing\n\n\u003e In any case, if you have a desire, you can support and contribute! Feel free to ask me any **feature** you need. \n\u003e **Thank you for your interest!** \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feliasku%2Funit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feliasku%2Funit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feliasku%2Funit/lists"}