{"id":27223583,"url":"https://github.com/vhotspur/pcut","last_synced_at":"2025-04-10T09:09:45.354Z","repository":{"id":5265192,"uuid":"6443663","full_name":"vhotspur/pcut","owner":"vhotspur","description":"Plain C unit testing framework","archived":false,"fork":false,"pushed_at":"2024-11-04T14:15:25.000Z","size":327,"stargazers_count":4,"open_issues_count":3,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-04T14:24:11.715Z","etag":null,"topics":["c","unit-testing"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"pockethub/PocketHub","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vhotspur.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2012-10-29T16:27:06.000Z","updated_at":"2024-11-04T14:15:32.000Z","dependencies_parsed_at":"2024-11-04T14:33:15.301Z","dependency_job_id":null,"html_url":"https://github.com/vhotspur/pcut","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/vhotspur%2Fpcut","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vhotspur%2Fpcut/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vhotspur%2Fpcut/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vhotspur%2Fpcut/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vhotspur","download_url":"https://codeload.github.com/vhotspur/pcut/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248190494,"owners_count":21062284,"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","unit-testing"],"created_at":"2025-04-10T09:09:44.779Z","updated_at":"2025-04-10T09:09:45.330Z","avatar_url":"https://github.com/vhotspur.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"PCUT: Plain C Unit Testing mini-framework\n=========================================\n\nPCUT is a very simple framework for unit testing of C code.\nUnlike many other frameworks where you need to specify manually which\nfunctions belong to a particular test, PCUT provides several smart\nmacros that hides this and lets you focus on the most important\npart of testing only: that is, coding the test cases.\n\nThis mini-framework is definitely not complete but it offers the basic\nfunctionality needed for writing unit tests.\nThis includes the possibility to group tests into test suites, optionally\nhaving set-up and tear-down functions.\nThere are several assert macros for evaluating the results, their highlight\nis very detailed information about the problem.\n\nThe output of the test can come in two forms: either as an XML output suited\nfor later processing or in the form of Test-Anything-Protocol.\nPCUT is able to capture standard output and display it together with test\nresults.\nAnd by running each test in a separate process, the whole framework is pretty\nsafe against unexpected crashes, such as null pointer dereference.\n\nMore details can be found on PCUT wiki on GitHub:\nhttps://github.com/vhotspur/pcut/wiki\n\n\nQuick-start example\n-------------------\n\nThe following code tests the standard ``atoi`` function::\n\n\t#include \u003cpcut/pcut.h\u003e\n\t#include \u003cstdlib.h\u003e\n\n\tPCUT_INIT\n\n\tPCUT_TEST(atoi_zero) {\n\t    PCUT_ASSERT_INT_EQUALS(0, atoi(\"0\"));\n\t}\n\n\tPCUT_TEST(atoi_positive) {\n\t    PCUT_ASSERT_INT_EQUALS(42, atoi(\"42\"));\n\t}\n\n\tPCUT_TEST(atoi_negative) {\n\t    PCUT_ASSERT_INT_EQUALS(-273, atoi(\"-273\"));\n\t}\n\n\tPCUT_MAIN()\n\nAs you can see, there is no manual listing of tests that form the test\nsuite etc, only the tests and ``PCUT_INIT`` at the beginning and\n``PCUT_MAIN`` at the end.\n\nThis code has to be linked with ``libpcut`` to get an executable that runs\nthe tests and reports the results.\n\nMore examples, in the form of self-tests, are available in the ``tests/``\nsubdirectory.\nOther examples can be found on the Wiki.\n\n\nBuilding and installing\n-----------------------\n\nPCUT uses CMake (http://www.cmake.org/).\nOn Unix systems, following commands build the library and execute the\nbuilt-in tests::\n\n\tmkdir build\n\tcd build\n\tcmake .. \u0026\u0026 make all test\n\nMore details can be found on https://github.com/vhotspur/pcut/wiki/Building.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvhotspur%2Fpcut","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvhotspur%2Fpcut","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvhotspur%2Fpcut/lists"}