{"id":23459614,"url":"https://github.com/d-led/cpp-testing-no-excuses","last_synced_at":"2025-04-14T04:15:35.606Z","repository":{"id":27968542,"uuid":"31461675","full_name":"d-led/cpp-testing-no-excuses","owner":"d-led","description":"there's no excuse not to do bdd/tdd in c++ projects","archived":false,"fork":false,"pushed_at":"2016-12-26T22:28:39.000Z","size":9555,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-14T04:15:25.427Z","etag":null,"topics":["bdd","cplusplus","cucumber","specification","testing","unit-testing"],"latest_commit_sha":null,"homepage":null,"language":"Makefile","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/d-led.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}},"created_at":"2015-02-28T12:15:10.000Z","updated_at":"2023-09-08T16:55:06.000Z","dependencies_parsed_at":"2022-09-01T00:31:09.070Z","dependency_job_id":null,"html_url":"https://github.com/d-led/cpp-testing-no-excuses","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d-led%2Fcpp-testing-no-excuses","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d-led%2Fcpp-testing-no-excuses/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d-led%2Fcpp-testing-no-excuses/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d-led%2Fcpp-testing-no-excuses/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/d-led","download_url":"https://codeload.github.com/d-led/cpp-testing-no-excuses/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248819408,"owners_count":21166477,"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","cplusplus","cucumber","specification","testing","unit-testing"],"created_at":"2024-12-24T06:16:02.798Z","updated_at":"2025-04-14T04:15:35.584Z","avatar_url":"https://github.com/d-led.png","language":"Makefile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cpp-testing-no-excuses\n\nthere's no excuse not to do bdd/tdd/ci (and many more) in cross-platform c++ projects\n\nAll tests are run on [travis-ci](https://travis-ci.org):\n[![Build Status](https://travis-ci.org/d-led/cpp-testing-no-excuses.svg?branch=master)](https://travis-ci.org/d-led/cpp-testing-no-excuses)\n\nSee the config for details: [.travis.yml](.travis.yml)\n\n\n## presentation\n\n- [26.03.2015 MUC++ Meetup @ TU-München](doc/2015_03_26_dled_no_excuses_meetup_at_tum.pdf)\n\n\n## outline\n\nsee [commits](https://github.com/d-led/cpp-testing-no-excuses/commits/master) and:\n\n- simple [premake](industriousone.com/premake)-based build config: [premake4.lua](premake4.lua)\n- lightweight testing based on [catch](http://catch-lib.net): [src/catch/simple.cpp](src/catch/simple.cpp)\n- polymorphic mocks based on [googlemock](https://code.google.com/p/googlemock/): [src/gmock/mocks.cpp](src/gmock/mocks.cpp)\n- lightweight bdd-style tests using [catch](http://catch-lib.net): [src/catch/bdd_style.cpp](src/catch/bdd_style.cpp)\n- [cucumber-cpp](https://github.com/cucumber/cucumber-cpp)-based behavior-style [spec/tests](https://cukes.info): [features/elements.feature](features/elements.feature), [src/cucumber/cppspec_steps.cpp](src/cucumber/cppspec_steps.cpp)\n- [hayai](https://github.com/nickbruun/hayai)-based simple and informative microbenchmarking: [src/hayai/to_string_benchmark.cpp](src/hayai/to_string_benchmark.cpp)\n- scripted testing without recompiles (i.e. for data-driven tests) using a [lua binding](src/lua/bindings.cpp) via [LuaBridge](https://github.com/vinniefalco/LuaBridge), and a [behavior spec](spec/counter_spec.lua) for testing with [busted](https://github.com/Olivine-Labs/busted)\n- an exploratory example for Visual Studio and [SpecFlow](www.specflow.org) can be found in [src/cppcli](src/cppcli)\n\n## generating build files\n\n`[path_to]/premake5 [build_target]`\n\nrun `[path_to]/premake5 --help` to find a suitable `[build_target]`\n\nif a feature is not implemented for the chosen platform in premake5, try premake4, since premake5 is still in \"alpha\".\n\n### customizing BOOST location (MS Windows)\n\nin [premake4.lua](premake4.lua) prior to `boost:set_*` calls, the paths to BOOST can be customized.\n\nEither the environment variable `BOOST` should be set to the BOOST root, or it can be set directly, i.e. `boost.includedirs.windows = [[d:\\\\my_boost\\1.55]]`.\n\nThe library paths are typically more complex, thus `boost:set_libdirs()` uses a pattern (see substitutions [boost.lua](https://github.com/d-led/premake-meta-cpp/blob/master/recipes/boost.lua#L60-L73), based on [BOOST binaries](http://sourceforge.net/projects/boost/files/boost-binaries/)). `boost.libdirs_pattern.windows` can be modified according to the installation, i.e.\n\n```lua\nboost.libdirs_pattern.windows = path.join(boost.includedirs.windows,'lib/$(PlatformTarget)')\n```\n\nIf you use boost in a custom configuration and you have to set defines, you can add defines in similar fashion:\n\n```lua\nlocal d = boost.defines.windows\nd[#d+1] = 'BOOST_REGEX_...'\nd[#d+1] = 'BOOST_....WHATEVER'\n```\n\n## running cucumber steps\n\nprerequisite: [cucumber](https://cukes.info) should be installed\n\nStart cucumber and the steps runner using `[path_to]/premake4 cucumber`. The actual command line is `bin/[path_to]/cucumber_example \u003e /dev/null \u0026 cucumber` on *X, and `start bin\\[path_to]\\cucumber_example \u0026\u0026 cucumber` on MS Windows.\n\n## running busted tests\n\nprerequisite: [busted](https://github.com/Olivine-Labs/busted), i.e. installed via [luarocks](https://rocks.moonscript.org/)\n\n`busted`\n\n## todo\n\n- [ ] property based testing using [rapidcheck](https://github.com/emil-e/rapidcheck) \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fd-led%2Fcpp-testing-no-excuses","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fd-led%2Fcpp-testing-no-excuses","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fd-led%2Fcpp-testing-no-excuses/lists"}