{"id":15291209,"url":"https://github.com/azure/umock-c","last_synced_at":"2025-10-16T15:15:15.901Z","repository":{"id":10874542,"uuid":"53913271","full_name":"Azure/umock-c","owner":"Azure","description":"A pure C mocking library","archived":false,"fork":false,"pushed_at":"2025-02-27T23:12:30.000Z","size":1278,"stargazers_count":33,"open_issues_count":40,"forks_count":24,"subscribers_count":51,"default_branch":"master","last_synced_at":"2025-03-17T11:53:39.453Z","etag":null,"topics":["c","cross-platform","easy-to-use","mock","mock-library","mocking","mocking-framework","mocks","unit-testing"],"latest_commit_sha":null,"homepage":null,"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/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-03-15T03:58:59.000Z","updated_at":"2025-02-25T18:03:58.000Z","dependencies_parsed_at":"2023-10-17T03:03:33.068Z","dependency_job_id":"a51aa7e1-38ca-45f2-926f-608bc0b9e319","html_url":"https://github.com/Azure/umock-c","commit_stats":{"total_commits":376,"total_committers":35,"mean_commits":"10.742857142857142","dds":0.5452127659574468,"last_synced_commit":"b0dfef4f7474053411b7a38b24f7d19373017cfe"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azure%2Fumock-c","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azure%2Fumock-c/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azure%2Fumock-c/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azure%2Fumock-c/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Azure","download_url":"https://codeload.github.com/Azure/umock-c/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247640464,"owners_count":20971557,"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","cross-platform","easy-to-use","mock","mock-library","mocking","mocking-framework","mocks","unit-testing"],"created_at":"2024-09-30T16:11:26.562Z","updated_at":"2025-10-08T10:59:14.602Z","avatar_url":"https://github.com/Azure.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"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# umock_c\n\numock_c is a C mocking library.\n\n## Setup\n\n### Build\n\n- Clone umock_c by:\n\n```\ngit clone --recursive https://github.com/Azure/umock-c.git\n```\n\n- Create a cmake folder under the root of umock-c\n\n- Switch to the cmake folder and run\n```\ncmake ..\n```\n\nIf you would like to use installed (by CMake) versions of packages already on your machine:\n\n```\ncmake -Duse_installed=ON ../\n```\n\n- Build the code for your platform (msbuild for Windows, make for Linux, etc.) by executing in the cmake folder: \n\n```\ncmake --build .\n```\n\n### To install umock_c:\n\n```\ncmake -Duse_installed=ON ../\n```\nOn Linux:\n```\nsudo make install\n```\nOn Windows:\n```\nmsbuild /m INSTALL.vcxproj\n```\n\n_This requires that ctest and testrunnerswitcher are both installed (through CMake) on your machine._\n\n### Building 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\nEver wanted to write something like this in C as a test?\n\n```c\nTEST_FUNCTION(my_first_test)\n{\n    // arrange\n    STRICT_EXPECTED_CALL(test_dependency_1_arg(42))\n        .SetReturn(44)\n        .IgnoreAllArguments();\n\n    // act\n    int result = function_under_test();\n\n    // assert\n    ASSERT_ARE_EQUAL(int, 44, result);\n    ASSERT_ARE_EQUAL(char_ptr, umock_c_get_expected_calls(), umock_c_get_actual_calls());\n}\n```\n\numock_c has way more features than this simple example!\n\n## Dependencies\n\n- umock_c uses ctest as test runner (https://github.com/Azure/azure-ctest.git). ctest is a C test runner that can be run on many platforms as it does not make use of compiler/platform specific code and thus it is easily portable.\n- umock_c uses cmake (https://cmake.org/) to generate build files.\n- umock_c uses testrunnerswitcher to allow switching between ctest and CppUnitTest for Windows. \n\n## Documentation\n\nComplete documentation is available [here](doc/umock_c.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazure%2Fumock-c","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fazure%2Fumock-c","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazure%2Fumock-c/lists"}