{"id":21465980,"url":"https://github.com/mp81ss/mpunit","last_synced_at":"2025-03-17T05:45:57.517Z","repository":{"id":194978272,"uuid":"415531531","full_name":"mp81ss/mpunit","owner":"mp81ss","description":"C++ unit test framwork","archived":false,"fork":false,"pushed_at":"2023-09-15T10:28:22.000Z","size":45,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-23T15:23:02.781Z","etag":null,"topics":["cplusplus","cpp","header-only","library","test","testing","testing-framework","unicode","xunit","xunit-framework","xunit-tests"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mp81ss.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}},"created_at":"2021-10-10T08:47:17.000Z","updated_at":"2021-10-12T12:27:23.000Z","dependencies_parsed_at":"2023-09-16T03:21:34.628Z","dependency_job_id":null,"html_url":"https://github.com/mp81ss/mpunit","commit_stats":null,"previous_names":["mp81ss/mpunit"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mp81ss%2Fmpunit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mp81ss%2Fmpunit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mp81ss%2Fmpunit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mp81ss%2Fmpunit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mp81ss","download_url":"https://codeload.github.com/mp81ss/mpunit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243982139,"owners_count":20378606,"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":["cplusplus","cpp","header-only","library","test","testing","testing-framework","unicode","xunit","xunit-framework","xunit-tests"],"created_at":"2024-11-23T08:12:45.031Z","updated_at":"2025-03-17T05:45:57.493Z","avatar_url":"https://github.com/mp81ss.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ARCHIVED - Moved to gitlab\r\n\r\n\r\n# MpUnit C++ unit-test framework\r\n\r\n## Introduction\r\nAn easy but featured testing free framework for C++, contained in **one header only**!\\\r\nIt is inspired to _CppUnit_, since basically test classes  are subclasses of _MpuTest_\\\r\nand override the _Run()_ method, suites are subclasses of _MpuSuite_\r\n\r\nYou have _setup()/teardown()_ virtual methods for **both** tests and suites.\\\r\nSuites are a set of tests that share the same environment.\r\n\r\nInside tests you can put your assertions.\r\n\r\n## Features\r\n - Just one header: No complex setup/installation\r\n - Highly Portable: Tested on windows, linux, freebsd, C++98/11/14/17,20,... (see [compatibility](#compatibility) section)\r\n - Very easy to use (see [examples](./examples))\r\n - Handle tests and suites (that are a set of tests)\r\n - Suites can set _setup()/teardown()_ methods before/after each test execution (test level)\r\n - Suites can set _SuiteSetup()/SuiteTeardown()_ before/after each suite execution (suite level)\r\n - Suppport stdout/file output\r\n - Support 4 different output formats (see [output formats](#output-formats) section)\r\n - Handle system exceptions (can be disabled)\r\n - Full support for unicode on windows (linux handle it automatically)\r\n\r\n## Output Formats\r\n 1. stdout (The default format)\r\n 2. HTML (A single .html page with pie chart, legend and detailed tests report)\r\n 3. JUNIT (The classic xml format used by test frameworks)\r\n 4. NULL (To be completely quiet)\r\n\r\n## Command Line\r\nMpUnit supports some options at run-time, that can be set in code and overridden in cli.\\\r\nYou can run your test executable with _-h_ to have a list of available options:\r\n - -h Show the help message\r\n - -f \\\u003cformat\\\u003e Where format can be one of: _stdout_, _html_, _junit_, _null_\r\n - -o \\\u003cfilename\\\u003e Write the output on _filename_\r\n - -x Disable the system exception handling (Define **MPU_NO_SEH** to disable at compile-time)\r\n - -e Stops execution at the first failed test\r\n\r\nExcept the _-h_ switch, all others can be set to the _MpUnit_ object:\r\n```cpp\r\nMpUnit mpunit;\r\nmpunit.outputFormat = MPU_OUTPUT_HTML; // MPU_OUTPUT_STDOUT is default, see enum MpuOutputType\r\nmpunit.outputFile = \"out.txt\";\r\nmpunit.enableSystemExceptions = false; // default is true\r\nmpunit.stopOnError = true; // default is false\r\n// addsuites/tests...\r\nmpunit.run(argc, argv); // pass argv/argc (optional) to make mpunit handle cli\r\n```\r\n\r\n## Compatibility\r\nMpUnit has been tested with several compilers, from recent to very old ones:\r\n - g++ (mingw, cygwin, linux)\r\n - clang (windows, freebsd)\r\n - Visual Studio\r\n - Digitalmars (unicode do not works)\r\n - Borland 5.5.1 (Define MPU_NO_SEH, unicode do not works). Newer versions should be better\r\n\r\n## Notes\r\n - All available assertions begin with _MPU_ASSERT_...\\\r\n   There is also _MPU_INFO_ to dump a custom message, and a **non-fatal** assertion _MPU_WARNING_\r\n - Tests/suites are executed in the order they are added. You can use the _Shuffle()_ method on both\\\r\n   _MpUnit_ and _MpuSuite_-derived objects to randomize tests execution order\r\n - You can query status with method _GetStatus_\r\n - You can reset the MpUnit object by calling method _Reset()_\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmp81ss%2Fmpunit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmp81ss%2Fmpunit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmp81ss%2Fmpunit/lists"}