{"id":21056211,"url":"https://github.com/christophercrouzet/rexo","last_synced_at":"2025-05-15T23:33:06.475Z","repository":{"id":42412707,"uuid":"136873550","full_name":"christophercrouzet/rexo","owner":"christophercrouzet","description":"Neat single-file cross-platform unit testing framework for C/C++.","archived":false,"fork":false,"pushed_at":"2023-11-25T02:59:53.000Z","size":1554,"stargazers_count":30,"open_issues_count":3,"forks_count":6,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-05-14T12:04:16.643Z","etag":null,"topics":["c","framework","header-only","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":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/christophercrouzet.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":"CODE-OF-CONDUCT.md","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-06-11T04:12:31.000Z","updated_at":"2025-02-01T22:26:17.000Z","dependencies_parsed_at":"2023-11-25T03:23:36.631Z","dependency_job_id":"4f48d7da-9bec-47a1-8cd2-ed93f322dc24","html_url":"https://github.com/christophercrouzet/rexo","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/christophercrouzet%2Frexo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/christophercrouzet%2Frexo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/christophercrouzet%2Frexo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/christophercrouzet%2Frexo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/christophercrouzet","download_url":"https://codeload.github.com/christophercrouzet/rexo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254442427,"owners_count":22071864,"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","framework","header-only","unit-testing"],"created_at":"2024-11-19T16:49:25.673Z","updated_at":"2025-05-15T23:33:01.757Z","avatar_url":"https://github.com/christophercrouzet.png","language":"C","funding_links":[],"categories":["Testing","测试"],"sub_categories":["YAML"],"readme":"![Test][badge-test]\n\nRexo\n====\n\nRexo is a neat single-file cross-platform unit testing framework for C/C++.\n\nIt offers the same [xUnit][xunit]-like structure than most other unit testing\nframeworks but aims at providing a _truly_ polished API.\n\n\n## Features\n\n* **sleek**: polished API with great attention to details.\n* **easy**: no learning curve, it's yet another framework based on xUnit\n  with test suites, test cases, and fixtures.\n* **convenient**: automatic registration of tests.\n* **granular**: high level or low level API? You choose.\n* **portable**: compatible with C89 (ANSI C) and C++.\n* **cross-platform**: tested on Linux, macOS, and Windows.\n* **simple**: straightforward implementation—KISS all the things!\n* **cascading configuration**: configure a whole test suite at once and/or tweak\n  specific options for each test case.\n* **painless**: deployment couldn't be easier—it all fits into a single\n  header file and has no external dependencies.\n\n\nBut also...\n\n* fully standard compliant minus the optional automatic registration of tests\n  that relies on a widespread compiler-specific feature.\n* designated initializer-like syntax to all C and C++ versions.\n\n\n## Roadmap\n\n* implement a command-line option parser (e.g.: for filtering test cases).\n* allow choosing the output format of the summary (e.g.: jUnit XML).\n* support more assertion macros (e.g.: array comparison, signal handling).\n* improve failure messages to be more visual (e.g.: an arrow pointing\n  where strings differ).\n\n\n## Usage\n\n### Minimal\n\n```c\n#include \u003crexo.h\u003e\n\nRX_TEST_CASE(foo, bar)\n{\n    RX_INT_REQUIRE_EQUAL(2 * 3 * 7, 42);\n}\n\nint\nmain(int argc, const char **argv)\n{\n    return rx_main(0, NULL, argc, argv) == RX_SUCCESS ? 0 : 1;\n}\n```\n\n![passed](./img/passed.png)\n\n\n### Fixture\n\n```c\n#include \u003crexo.h\u003e\n\nstruct foo_data {\n    const char *value;\n};\n\nRX_SET_UP(foo_set_up)\n{\n    struct foo_data *data;\n\n    data = (struct foo_data *)RX_DATA;\n    data-\u003evalue = \"world!\";\n    return RX_SUCCESS;\n}\n\nRX_FIXTURE(foo_fixture, struct foo_data, .set_up = foo_set_up);\n\nRX_TEST_CASE(foo, bar, .fixture = foo_fixture)\n{\n    struct foo_data *data;\n\n    data = (struct foo_data *)RX_DATA;\n    RX_STR_REQUIRE_EQUAL(\"Hello\", data-\u003evalue);\n}\n\nint\nmain(int argc, const char **argv)\n{\n    return rx_main(0, NULL, argc, argv) == RX_SUCCESS ? 0 : 1;\n}\n```\n\n![failed](img/failed.png)\n\n\n## Documentation\n\n\u003chttps://christophercrouzet.github.io/rexo\u003e\n\n\n## Repository\n\n\u003chttps://github.com/christophercrouzet/rexo\u003e\n\n\n## License\n\n[Unlicense][unlicense].\n\n\n[badge-test]: https://github.com/christophercrouzet/rexo/workflows/Test/badge.svg\n[unlicense]: https://unlicense.org\n[xunit]: https://en.wikipedia.org/wiki/XUnit\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchristophercrouzet%2Frexo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchristophercrouzet%2Frexo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchristophercrouzet%2Frexo/lists"}