{"id":15291215,"url":"https://github.com/azure/ctest","last_synced_at":"2025-10-20T03:31:17.295Z","repository":{"id":38424316,"uuid":"58098060","full_name":"Azure/ctest","owner":"Azure","description":"A simple portable C test runner","archived":false,"fork":false,"pushed_at":"2025-01-29T01:35:03.000Z","size":471,"stargazers_count":19,"open_issues_count":5,"forks_count":12,"subscribers_count":52,"default_branch":"master","last_synced_at":"2025-01-30T13:51:12.878Z","etag":null,"topics":["c","test-runner","testing","testing-tools","tests"],"latest_commit_sha":null,"homepage":null,"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/Azure.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":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-05-05T02:23:48.000Z","updated_at":"2025-01-16T19:38:22.000Z","dependencies_parsed_at":"2023-10-02T06:33:14.484Z","dependency_job_id":"6c6f1120-5ff6-4fd8-9c2f-893dcf049a17","html_url":"https://github.com/Azure/ctest","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/Azure%2Fctest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azure%2Fctest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azure%2Fctest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azure%2Fctest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Azure","download_url":"https://codeload.github.com/Azure/ctest/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237254238,"owners_count":19280007,"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","test-runner","testing","testing-tools","tests"],"created_at":"2024-09-30T16:11:27.990Z","updated_at":"2025-10-20T03:31:16.751Z","avatar_url":"https://github.com/Azure.png","language":"C","readme":"This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.\n\n# ctest\n\nctest is a simple portable C test runner.\n\n## Setup\n\n1. Clone **ctest** by:\n\n```\ngit clone https://github.com/Azure/ctest\n```\n\n2. Create a folder called *cmake* (or any name of your choice).\n\n3. Switch to the *cmake* folder and run\n```\ncmake ..\n```\n\n### Build\n\nSwitch to the *cmake* folder and run:\n\n```\ncmake --build .\n```\n\n### Installation and Use\nOptionally, you may choose to install ctest on your machine:\n\n1. Switch to the *cmake* folder and run\n    ```\n    cmake --build . --target install\n    ```\n    or\n\n    Linux:\n    ```\n    sudo make install\n    ```\n\n    Windows:\n    ```\n    msbuild /m INSTALL.vcxproj\n    ```\n\n2. Use it in your project (if installed)\n    ```\n    find_package(ctest REQUIRED CONFIG)\n    target_link_library(yourlib ctest)\n    ```\n\n### Building the tests\n\nIn order to build the tests use the *run_unittests* cmake option:\n\n```\ncmake .. -Drun_unittests:bool=ON\n```\n\n## Example\n\n```c\n#include \"ctest.h\"\n#include \"SomeUnitUnderTest.h\"\n\nCTEST_BEGIN_TEST_SUITE(SimpleTestSuiteOneTest)\n\nCTEST_FUNCTION(Test1)\n{\n    // arrange\n\n    // act\n    int x = SomeFunction();\n\n    // assert\n    CTEST_ASSERT_ARE_EQUAL(int, 42, x);\n}\n\nCTEST_END_TEST_SUITE(SimpleTestSuiteOneTest)\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazure%2Fctest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fazure%2Fctest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazure%2Fctest/lists"}