{"id":28475930,"url":"https://github.com/maxtek6/maxtest","last_synced_at":"2025-07-01T19:30:55.583Z","repository":{"id":296799587,"uuid":"905735737","full_name":"maxtek6/maxtest","owner":"maxtek6","description":"Lightweight unit testing framework for C++ and CMake","archived":false,"fork":false,"pushed_at":"2025-06-02T04:26:43.000Z","size":5,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-06-02T14:08:00.486Z","etag":null,"topics":[],"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/maxtek6.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":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-12-19T12:22:28.000Z","updated_at":"2025-06-02T04:26:43.000Z","dependencies_parsed_at":"2025-06-03T08:03:03.066Z","dependency_job_id":null,"html_url":"https://github.com/maxtek6/maxtest","commit_stats":null,"previous_names":["maxtek6/maxtest"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/maxtek6/maxtest","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxtek6%2Fmaxtest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxtek6%2Fmaxtest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxtek6%2Fmaxtest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxtek6%2Fmaxtest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maxtek6","download_url":"https://codeload.github.com/maxtek6/maxtest/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxtek6%2Fmaxtest/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263025021,"owners_count":23401701,"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":[],"created_at":"2025-06-07T15:05:39.466Z","updated_at":"2025-07-01T19:30:55.546Z","avatar_url":"https://github.com/maxtek6.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Maxtest\n\nSimple unit testing framework for C/C++ and CMake. This project was \ncreated due to the significant overlap in the unit testing code for\nour existing C and C++ projects.\n\nThis is not meant to be a replacement for GTest or any other widely\nused testing framework. It lacks support for benchmarking, mocking,\nand other features that would be useful for a complex project. This\nframework is most useful for developers who want to bootstrap simple\nunit tests to establish test coverage in their projects.\n\n## Requirements\n\n+ C++11\n+ CMake \u003e= 3.10\n\n## Basic Usage\n\nA basic unit test file should be written as follows:\n\n```c++\n#include \u003cmaxtest.hpp\u003e\n\n// any additional classes or functions here\n\nMAXTEST_MAIN\n{\n    MAXTEST_TEST_CASE(test_name)\n    {\n        const int n(5);\n        MAXTEST_ASSERT(n \u003e 0);  \n    };\n}\n```\n\nThere are 3 macros defined by the `maxtest.hpp` header:\n\n+ `MAXTEST_ASSERT(COND)`: assert the result of a boolean expression. If\nthe evaluated expression is `false`, the test will fail.\n+ `MAXTEST_TEST_CASE(NAME)`: defines a single test case to be run. By\ndefault, a test case will always pass unless one of the assertions\ninvoked by `MAXTEST_ASSERT` fails.\n+ `MAXTEST_MAIN`: indicates the start of the block where the test cases\nwill be defined. All test cases must be declared in this block. No other\nclasses or functions can be declared in this block.\n+ Note that any calls to the functions in the `maxtest` namespace may be\nlegal, but they are not recommended and their behavior is undefined.\n\n## Integration with CMake\n\nMaxtest can be integrated as a git submodule or imported via `FetchContent`:\n```cmake\nFetchContent_Declare(\n    Maxtest\n    GIT_REPOSITORY https://github.com/maxtek6/maxtest.git\n    GIT_TAG master\n)\nFetchContent_MakeAvailable(Maxtest)\n```\n\nOnce the package has been imported, an executable can be created using the\ntargets. Assume the file `main.cpp` has the example code from above:\n\n```cmake\nmaxtest_add_executable(unittest main.cpp)\n```\n\nUsing the `maxtest_add_test` command, declare each test name as declared in\nthe source file using `MAXTEST_TEST_CASE`:\n\n```cmake\n# \"\" represents any additional args passed when the test is run\nmaxtest_add_test(unittest test_name)\nmaxtest_add_test(unittest test_name_with_args arg1 arg2)\n```\n\n## Roadmap\n\n+ Test coverage using `gcovr`\n+ Improved CMake functions","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxtek6%2Fmaxtest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaxtek6%2Fmaxtest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxtek6%2Fmaxtest/lists"}