{"id":13419133,"url":"https://github.com/banditcpp/bandit","last_synced_at":"2025-03-15T04:32:05.552Z","repository":{"id":9664071,"uuid":"11603948","full_name":"banditcpp/bandit","owner":"banditcpp","description":"Human-friendly unit testing for C++11","archived":false,"fork":false,"pushed_at":"2024-02-04T14:03:43.000Z","size":5146,"stargazers_count":260,"open_issues_count":14,"forks_count":37,"subscribers_count":24,"default_branch":"main","last_synced_at":"2024-11-11T00:02:30.829Z","etag":null,"topics":["bdd","behavior-driven-development","c-plus-plus","c-plus-plus-11","cpp","cpp-library","cpp11","header-only","library","tdd","test-driven-development","test-framework","testing","testing-framework","testing-library"],"latest_commit_sha":null,"homepage":"https://banditcpp.github.io/bandit/","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/banditcpp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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}},"created_at":"2013-07-23T08:58:22.000Z","updated_at":"2024-09-11T20:56:07.000Z","dependencies_parsed_at":"2024-07-22T04:57:05.872Z","dependency_job_id":"92978303-a771-4d01-97b4-10d8c300dbc1","html_url":"https://github.com/banditcpp/bandit","commit_stats":null,"previous_names":["joakimkarlsson/bandit"],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/banditcpp%2Fbandit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/banditcpp%2Fbandit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/banditcpp%2Fbandit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/banditcpp%2Fbandit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/banditcpp","download_url":"https://codeload.github.com/banditcpp/bandit/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243685506,"owners_count":20330980,"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":["bdd","behavior-driven-development","c-plus-plus","c-plus-plus-11","cpp","cpp-library","cpp11","header-only","library","tdd","test-driven-development","test-framework","testing","testing-framework","testing-library"],"created_at":"2024-07-30T22:01:11.782Z","updated_at":"2025-03-15T04:32:05.173Z","avatar_url":"https://github.com/banditcpp.png","language":"C++","readme":"bandit\n======\n[![MIT License](https://img.shields.io/badge/license-MIT%20License-blue.svg)](LICENSE.txt)\n[![Contributors](https://img.shields.io/github/contributors/banditcpp/bandit.svg)](https://github.com/banditcpp/bandit/graphs/contributors)\n[![Watchers](https://img.shields.io/github/watchers/banditcpp/bandit.svg)](https://github.com/banditcpp/bandit/watchers)\n[![Stars](https://img.shields.io/github/stars/banditcpp/bandit.svg)](https://github.com/banditcpp/bandit/stargazers)\n[![Forks](https://img.shields.io/github/forks/banditcpp/bandit.svg)](https://github.com/banditcpp/bandit/network/members)\n[![Commits per year](https://img.shields.io/github/commit-activity/y/banditcpp/bandit.svg)](https://github.com/banditcpp/bandit/graphs/code-frequency)\n[![Last commit](https://img.shields.io/github/last-commit/banditcpp/bandit/master.svg)](https://github.com/banditcpp/bandit/commits/master)\n[![Travis CI Status](https://img.shields.io/travis/banditcpp/bandit/master.svg?label=tests+on+UNIX)](https://travis-ci.org/banditcpp/bandit)\n[![AppVeyor Status](https://img.shields.io/appveyor/ci/banditcpp/bandit/master.svg?label=tests+on+Windows)](https://ci.appveyor.com/project/banditcpp/bandit)\n[![Codecov Badge](https://img.shields.io/codecov/c/github/banditcpp/bandit/master.svg)](https://codecov.io/gh/banditcpp/bandit)\n[![Codacy Badge](https://img.shields.io/codacy/grade/8b00743b0047469bbe794cdc35832a73/master.svg)](https://www.codacy.com/app/sbeyer/bandit?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=banditcpp/bandit\u0026amp;utm_campaign=Badge_Grade)\n[![Coverity Scan Build Status](https://img.shields.io/coverity/scan/14169.svg)](https://scan.coverity.com/projects/banditcpp-bandit)\n[![Issues](https://img.shields.io/github/issues/banditcpp/bandit.svg)](https://github.com/banditcpp/bandit/issues)\n[![Pull Requests](https://img.shields.io/github/issues-pr/banditcpp/bandit.svg)](https://github.com/banditcpp/bandit/pulls)\n[![freenode](https://img.shields.io/badge/chat-%20on%20freenode-brightgreen.svg)](//webchat.freenode.net/?channels=%23banditcpp)\n[![Conan Center](https://shields.io/conan/v/bandit)](https://conan.io/center/recipes/bandit)\n\nHuman-friendly unit testing for C++11\n\nBandit is a framework for C++11 that wants to make working with unit tests a\npleasant experience.\n\n## An example\n\nThis is a complete test application written in bandit:\n\n```c++\n#include \u003cbandit/bandit.h\u003e\n\nusing namespace snowhouse;\nusing namespace bandit;\n\n// Tell bandit there are tests here.\ngo_bandit([]() {\n  // We're describing how a fuzzbox works.\n  describe(\"fuzzbox\", []() {\n    guitar_ptr guitar;\n    fuzzbox_ptr fuzzbox;\n\n    // Make sure each test has a fresh setup with\n    // a guitar with a fuzzbox connected to it.\n    before_each([\u0026]() {\n      guitar = guitar_ptr(new struct guitar());\n      fuzzbox = fuzzbox_ptr(new struct fuzzbox());\n      guitar-\u003eadd_effect(fuzzbox.get());\n    });\n\n    it(\"starts in clean mode\", [\u0026]() {\n      AssertThat(guitar-\u003esound(), Equals(sounds::clean));\n    });\n\n    // Describe what happens when we turn on the fuzzbox.\n    describe(\"in distorted mode\", [\u0026]() {\n      // Turn on the fuzzbox.\n      before_each([\u0026]() {\n        fuzzbox-\u003eflip();\n      });\n\n      it(\"sounds distorted\", [\u0026]() {\n        AssertThat(guitar-\u003esound(), Equals(sounds::distorted));\n      });\n    });\n  });\n});\n\nint main(int argc, char* argv[]) {\n  // Run the tests.\n  return bandit::run(argc, argv);\n}\n```\n\n## Download\n\nClone the Git repository:\n\n```sh\ngit clone --recursive https://github.com/banditcpp/bandit.git\n```\n\nor if you have already cloned the repository without `--recursive`, do\n\n```sh\ncd bandit\ngit submodule update --init --recursive\n```\n\nThe Git repository contains several directories besides bandit itself,\nthat is, the specifications (or tests) for bandit (in `specs`),\nthe bandit website and documentation (in `docs`),\nand auxiliary tools for CMake (in `cmake`) and continuous integration (in `util`).\n\n## Installation\n\nBandit is header-only, so there is no need for additional compilation before you\ncan start using it. (CMake is only necessary to compile the specs for bandit itself.)\n\nIf you want to use bandit inside your projects,\nadd the parent directory of the `bandit` directory to your project's\ninclude directories and you are ready to go.\n\nNote that you can remove all directories except the `bandit` directory.\nAlso keep license and copyright information intact.\nYou can also simply use the `headers-only` branch as a submodule:\n\n```sh\ngit submodule add -b headers-only https://github.com/banditcpp/bandit bandit\ngit submodule update --init --recursive\n```\n\n## Compilers\n\nBandit has been tested with the following compilers:\n\n * GCC ≥ 4.5\n * Clang ≥ 3.2\n * MSVC ≥ 2012\n\nIf you want to see if bandit works for your compiler, bandit is shipped with a\ncmake project for generating bandit's self tests. Let us know how it goes.\n\nIf your compiler does not support the C++11 features required by Bandit, we\nsuggest that you take a look at [Igloo](//iglootesting.wordpress.com/), which is\nbuilt on the same philosophy but works without C++11.\n\n## Online resources\n\n * [The bandit website](//banditcpp.github.io/bandit)\n * [Bandit on GitHub](//github.com/banditcpp/bandit)\n * [Issues with bandit](//github.com/banditcpp/bandit/issues?state=open)\n * IRC: [#banditcpp on freenode](//webchat.freenode.net?channels=%23banditcpp)\n","funding_links":[],"categories":["TODO scan for Android support in followings"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbanditcpp%2Fbandit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbanditcpp%2Fbandit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbanditcpp%2Fbandit/lists"}