{"id":22796576,"url":"https://github.com/macmade/gmock-xcode","last_synced_at":"2026-03-12T00:33:36.854Z","repository":{"id":25774437,"uuid":"29212753","full_name":"macmade/gmock-xcode","owner":"macmade","description":"Xcode integration for GoogleMock through XCTest","archived":false,"fork":false,"pushed_at":"2023-02-24T10:22:50.000Z","size":3455,"stargazers_count":22,"open_issues_count":0,"forks_count":6,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-19T17:12:44.587Z","etag":null,"topics":["c-plus-plus","gmock","google-test","googlemock","googlemock-test","gtest","integration","test","testing","testing-tools","xcode","xcodebuild","xctest"],"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/macmade.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","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,"zenodo":null},"funding":{"github":"macmade"}},"created_at":"2015-01-13T21:43:13.000Z","updated_at":"2023-04-30T10:13:04.000Z","dependencies_parsed_at":"2025-04-19T13:14:41.480Z","dependency_job_id":"de34486a-0a48-40e2-9062-533cd6bd698f","html_url":"https://github.com/macmade/gmock-xcode","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/macmade/gmock-xcode","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/macmade%2Fgmock-xcode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/macmade%2Fgmock-xcode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/macmade%2Fgmock-xcode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/macmade%2Fgmock-xcode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/macmade","download_url":"https://codeload.github.com/macmade/gmock-xcode/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/macmade%2Fgmock-xcode/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30408492,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-11T22:36:59.286Z","status":"ssl_error","status_checked_at":"2026-03-11T22:36:57.544Z","response_time":84,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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-plus-plus","gmock","google-test","googlemock","googlemock-test","gtest","integration","test","testing","testing-tools","xcode","xcodebuild","xctest"],"created_at":"2024-12-12T05:13:37.887Z","updated_at":"2026-03-12T00:33:36.837Z","avatar_url":"https://github.com/macmade.png","language":"C++","funding_links":["https://github.com/sponsors/macmade"],"categories":[],"sub_categories":[],"readme":"GoogleMock - Xcode\n==================\n\n[![Build Status](https://img.shields.io/github/actions/workflow/status/macmade/gmock-xcode/ci-mac.yaml?label=macOS\u0026logo=apple)](https://github.com/macmade/gmock-xcode/actions/workflows/ci-mac.yaml)\n[![Issues](http://img.shields.io/github/issues/macmade/gmock-xcode.svg?logo=github)](https://github.com/macmade/gmock-xcode/issues)\n![Status](https://img.shields.io/badge/status-legacy-red.svg?logo=git)\n![License](https://img.shields.io/badge/license-mit-brightgreen.svg?logo=open-source-initiative)  \n[![Contact](https://img.shields.io/badge/follow-@macmade-blue.svg?logo=twitter\u0026style=social)](https://twitter.com/macmade)\n[![Sponsor](https://img.shields.io/badge/sponsor-macmade-pink.svg?logo=github-sponsors\u0026style=social)](https://github.com/sponsors/macmade)\n\nAbout\n-----\n\nThis project consists of an integration of the GoogleMock library to Apple's Xcode IDE.\n\nSince version 5, Xcode provides a nice way to write unit tests with the `XCTest` framework.  \nUnit tests written with `XCTest` are integrated to the IDE, providing visual feedback when running tests. They are also integrated with the different build toolchains, like `xcodebuild` or Facebook's `xctool`.\n\nIt was specifially designed for Objective-C, writing unit tests for other languages (such as C++) is not so great with `XCTest`. \nOf course, this is possible using Objective-C++, but writing an Objective-C class for each C++ test case leads to some undesired overhead.\n\nGoogleMock is nice unit testing library for C++. The only issue is that it does not integrate well with Xcode, as does `XCTest`.  \nThis mean the IDE won't provide visual feedback for the unit tests written with GoogleMock, and you'll have to look at the console output to inspect any failed test.\n\nSo this project fixes this issue by bridging GoogleMock to `XCTest`.\n\n### Implementation details\n\n`XCTest` works by analysing test classes at runtime, thanks to Objective-C dynamic nature.  \nBasically, when the test bundle is loaded, it will look for all classes extending `XCTestCase`, and look for methods beginning with the `test` prefix.\n\nIf such a class is available, it will then create an instance, and launch each test method, reporting the result to the IDE.\n\nThis project consists of a framework which has to be linked to the unit test bundle. The framework includes GoogleMock, so you don't have to build it by yourself.\n\nIt works by querying each GoogleMock test case. For each one, a specific subclass of `XCTestCase` will be dynamically created at runtime.  \nFor each test in a test case, an Objective-C method will be created and added to the `XCTestCase` subclass.\n\nThe GoogleMock test cases are then run, reporting the usual output to the console.\n\nThen, as we created new classes compatible with `XCTest`, it will find them, and run them as usual.  \nEach method will simply look at the GoogleMock test result, and report the status using `XCTest` assertions, so we got visual feedback, as if we had written our test cases using `XCTest`.\n\n\nProject Configuration\n---------------------\n\nIn order to use these features, your unit test bundle needs to be linked to the provided frameworks.\n\nThe easiest way to do this is to include the provided Xcode project (`GoogleMock.xcodeproj`) as a subproject of your own Xcode project, so all targets are available.\n\nThen, from the `Build Phases` screen of your unit test's target, add the following frameworks to the `Target Dependancies` step:\n\n * GoogleMock\n\nAdds the same frameworks to the `Link Binary With Libraries` step, and you're done.  \nYour unit test bundle is now ready to use GoogleMock.\n\n\nWriting tests\n-------------\n\nWriting GoogleMock tests is also straightforward.  \nSimply include `\u003cGoogleMock/GoogleMock.h\u003e` to your `.cpp` file, and write your tests as usual.\n\nFor instance:\n\n    #include \u003cGoogleMock/GoogleMock.h\u003e\n    \n    using namespace testing;\n    \n    TEST( MyTestCase, MyTest )\n    {\n        ASSERT_TRUE( true );\n    }\n\nIn the above example, a subclass of `XCTestCase` named `MyTestCase` will be created at runtime, with a test method called `testMyTest`, so you can easily inspect the results of your GoogleMock tests directly from the Xcode tests tab.\n\nLicense\n-------\n\nThe GoogleMock Xcode integration library is released under the terms of the MIT License.\n\nRepository Infos\n----------------\n\n    Owner:\t\t\tJean-David Gadina - XS-Labs\n    Web:\t\t\twww.xs-labs.com\n    Blog:\t\t\twww.noxeos.com\n    Twitter:\t\t@macmade\n    GitHub:\t\t\tgithub.com/macmade\n    LinkedIn:\t\tch.linkedin.com/in/macmade/\n    StackOverflow:\tstackoverflow.com/users/182676/macmade\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmacmade%2Fgmock-xcode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmacmade%2Fgmock-xcode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmacmade%2Fgmock-xcode/lists"}