{"id":19280890,"url":"https://github.com/islamhaqq/sahltestingframework","last_synced_at":"2025-02-23T22:18:24.158Z","repository":{"id":158530942,"uuid":"634085124","full_name":"islamhaqq/SahlTestingFramework","owner":"islamhaqq","description":"Unit Testing Framework (Mocking Library Included)","archived":false,"fork":false,"pushed_at":"2024-03-03T15:16:38.000Z","size":77,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-05T16:44:29.964Z","etag":null,"topics":["automation","automation-framework","google-test","mocking","mocking-library","tdd","testing","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/islamhaqq.png","metadata":{"files":{"readme":"README.md","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}},"created_at":"2023-04-29T02:19:26.000Z","updated_at":"2023-10-24T13:22:52.000Z","dependencies_parsed_at":"2023-05-21T11:00:13.656Z","dependency_job_id":"8a8e7526-6f51-48a9-8356-ea20c63436d2","html_url":"https://github.com/islamhaqq/SahlTestingFramework","commit_stats":null,"previous_names":["syedaman/sahltestingframework","islamhaqq/sahltestingframework"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/islamhaqq%2FSahlTestingFramework","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/islamhaqq%2FSahlTestingFramework/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/islamhaqq%2FSahlTestingFramework/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/islamhaqq%2FSahlTestingFramework/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/islamhaqq","download_url":"https://codeload.github.com/islamhaqq/SahlTestingFramework/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240385334,"owners_count":19792990,"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":["automation","automation-framework","google-test","mocking","mocking-library","tdd","testing","unit-testing"],"created_at":"2024-11-09T21:20:57.470Z","updated_at":"2025-02-23T22:18:24.004Z","avatar_url":"https://github.com/islamhaqq.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TestingFramework\n\nA unit testing framework for C++ that includes:\n* Test running\n* Test specification\n* Expectations\n* Mocking\n\nThe heavy usage of macros takes inspiration from Google Test. Although the implementation is different, the interface for creating tests and mocking has similaries to gtest and gmock. \n\n## Example Usage\nYou can take a look at the automation tests under the `/Tests` directory for the most up-to-date self-documentation. But here are some test usages if you don't want to do that:\n\n```cpp\nclass SomeInterface\n{\npublic:\n    virtual int SomeMethod() = 0;\n    virtual int SomeOtherMethod() = 0;\n    virtual bool SomeBoolMethod() = 0;\n    virtual std::string SomeStringMethod() = 0;\n};\n\nclass MockImplementation : public SomeInterface\n{\n    MOCK_METHOD(int, SomeMethod)\n    MOCK_METHOD(int, SomeOtherMethod)\n    MOCK_METHOD(bool, SomeBoolMethod)\n    MOCK_METHOD(std::string, SomeStringMethod)\n};\n\nS_TEST(MyTestSuite, MyTest)\n{\n    MockImplementation mockImplementation;\n    ON_CALL(mockImplementation, SomeMethod).WillByDefault([]() { return 5; });\n    S_EXPECT_EQ(mockImplementation.SomeMethod(), 5);\n\n    ON_CALL(mockImplementation, SomeOtherMethod).WillByDefault([]() { return 6; });\n    S_EXPECT_EQ(mockImplementation.SomeOtherMethod(), 6);\n\n    ON_CALL(mockImplementation, SomeBoolMethod).WillByDefault([]() { return true; });\n    S_EXPECT_TRUE(mockImplementation.SomeBoolMethod());\n    ON_CALL(mockImplementation, SomeBoolMethod).WillByDefault([]() { return false; });\n    S_EXPECT_FALSE(mockImplementation.SomeBoolMethod());\n\n    ON_CALL(mockImplementation, SomeStringMethod).WillByDefault([]() { return \"Hello\"; });\n    S_EXPECT_STREQ(mockImplementation.SomeStringMethod().c_str(), \"Hello\");\n}\n```\n\n# Installation\n\nYou will need to following dependencies:\n* [CMake](https://cmake.org/download/)\n* [GCC/G++ (Linux)](https://gcc.gnu.org/install/)\n* [MSVC (Windows)](https://visualstudio.microsoft.com/downloads/)\n* [xlib w/ XRandR and XTest (Linux)](https://www.x.org/wiki/)\n\n\n## Linux\n```bash\nsudo apt-get install libxrandr-dev\nsudo apt-get install libxtst-dev\n\ncd SahlTestingFramework\ncmake -B build\ncmake --build build\n\n# Run tests to make sure everything is working\ncd build\nctest --extra-verbose\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fislamhaqq%2Fsahltestingframework","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fislamhaqq%2Fsahltestingframework","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fislamhaqq%2Fsahltestingframework/lists"}