{ "info": { "author": "spoorcc", "author_email": "", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: ISC License (ISCL)", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Software Development :: Build Tools" ], "description": "# CppUMockify\n\nCloned from [Marco M/Mockify](https://bitbucket.org/marco_m/mockify)\n\n[![Build Status](https://travis-ci.org/spoorcc/CppUMockify.svg?branch=master)](https://travis-ci.org/spoorcc/CppUMockify)\n[![PyPI version](https://badge.fury.io/py/CppUMockify.svg)](https://badge.fury.io/py/CppUMockify)\n![PyPI - License](https://img.shields.io/pypi/l/CppUMockify.svg)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/CppUMockify.svg)\n\nGenerate complete boilerplate code for [CppUTest][] C/C++ mocks.\n\nWhen writing mocks, the majority of the code is just boring boilerplate. For\nexample, to mock\n\n int zoo_cat(int a)\n\none has to write:\n\n 1 int zoo_cat(int a) {\n 2 mock().actualCall(\"zoo_cat\")\n 3 .withParameter(\"a\", a);\n 4 if mock().hasReturnValue() {\n 5 return mock().intReturnValue();\n 6 }\n 7 return something(a);\n 8 }\n\nwhere *everything* but line 7 is boilerplate. Multiply this for the tens of\nmocks needed also for the smallest unit test and the task quickly becomes\nboring and error-prone.\n\nCppUMockify is written in Python and thanks to the excellent [pycparser][] parses\nthe C code of the function prototype to mock and generates all the needed\nboilerplate :-)\n\n## Development status\n\nAlready usable with basic functionalities. Most important missing parts:\n\n- support for basic typedefs (eg `size_t`) both as function type and as function\nargument\n- support for output parameters (eg `void foo(int* bar)`)\n\n## Installation\n\n pip install CppUMockify\n\n## Usage\n\nCppUMockify is designed to be used with any editor or IDE, or just from the shell.\n\nAssuming that function `zoo_cat()` is declared in header file `zoo.h`, calling:\n\n cppumockify.py zoo \"int zoo_cat(int a);\"\n\nwill generate mock file `zoo_mock.cpp`, containing the mock boilerplate for\nfunction `zoo_cat()`.\n\nSubsequent calls to cppumockify matching on the header file will append the new\nmock boilerplate to `zoo_mock.cpp`. For example\n\n cppumockify.py zoo \"int zoo_dog(int b);\"\n\nwill append the boilerplate mock for `zoo_dog()`.\n\n## Suggested workflow\n\nBring a source file under unit test. Once the compilation is succesful, you\nwill start to have linker errors for all the functions you need to mock.\n\nCopy the first unfound symbol from the linker, search for it (using your IDE,\ncscope, ctags, ...), go to the corresponding header file. Copy and paste the\nfunction declaration and pass it to cppumockify.\n\nThe above steps can be automated within your editor or IDE. For CLion, you can\nuse it as an \"external tool\" and pass it automatically the name of the header\nfile and the copy and paste of the function declaration.\n\nAdd the generated mock file to the build. Open the generated mock file, check\nand complete the mock boilerplate.\n\nRinse and repeat :-)\n\n\n[CppUTest]: https://cpputest.github.io\n[pycparser]: https://github.com/eliben/pycparser", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/spoorcc/cppumockify", "keywords": "cpputest cppumock pycparser", "license": "", "maintainer": "", "maintainer_email": "", "name": "CppUMockify", "package_url": "https://pypi.org/project/CppUMockify/", "platform": "", "project_url": "https://pypi.org/project/CppUMockify/", "project_urls": { "Bug Reports": "https://github.com/spoorcc/cppumockify/issues", "Homepage": "https://github.com/spoorcc/cppumockify", "Source": "https://github.com/spoorcc/cppumockify/" }, "release_url": "https://pypi.org/project/CppUMockify/0.0.6/", "requires_dist": null, "requires_python": "", "summary": "Generate CppUMock implementations", "version": "0.0.6" }, "last_serial": 3924855, "releases": { "0.0.2": [ { "comment_text": "", "digests": { "md5": "7924178c3f1fff66128bdb3c13470374", "sha256": "47b2a7913b65db86cc0fd75fa02bf200f0e3d208831422de50c354fea8994261" }, "downloads": -1, "filename": "CppUMockify-0.0.2.tar.gz", "has_sig": false, "md5_digest": "7924178c3f1fff66128bdb3c13470374", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5299, "upload_time": "2018-06-01T20:43:34", "url": "https://files.pythonhosted.org/packages/f6/41/6d9a2c22a21fc5ddf5dfa3be15690f6563c46911708030348a18b5330734/CppUMockify-0.0.2.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "177f08c5a93c47b2be7f2d296a2c1d2d", "sha256": "e852449bf414ce94990220ba9110807c19aebded39206af0a3f263363ee4d082" }, "downloads": -1, "filename": "CppUMockify-0.0.4.tar.gz", "has_sig": false, "md5_digest": "177f08c5a93c47b2be7f2d296a2c1d2d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5385, "upload_time": "2018-06-01T21:02:00", "url": "https://files.pythonhosted.org/packages/f3/db/37708eacfcca88a393a9e2fbe96b45a7eb6c7537adaaae60d5b3855d7c6f/CppUMockify-0.0.4.tar.gz" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "fe9449be527c8e7b0a64ff8c2d4864e5", "sha256": "bcca826d1f68b7abf69821667f7bbe8e4aae9a850732b37be5bf33d4c133d046" }, "downloads": -1, "filename": "CppUMockify-0.0.5.tar.gz", "has_sig": false, "md5_digest": "fe9449be527c8e7b0a64ff8c2d4864e5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5529, "upload_time": "2018-06-02T11:44:06", "url": "https://files.pythonhosted.org/packages/b9/14/0f1804800aa85d5e9f14547d483931a3e024cb063be698582c4ee822a3d8/CppUMockify-0.0.5.tar.gz" } ], "0.0.6": [ { "comment_text": "", "digests": { "md5": "d6e4064e14a1fdc6ec6135885354b34b", "sha256": "85b43919e6beca5b7d6dd010ffb0e8059ed176d9095f1da6b8d8e38eeb8fc17b" }, "downloads": -1, "filename": "CppUMockify-0.0.6.tar.gz", "has_sig": false, "md5_digest": "d6e4064e14a1fdc6ec6135885354b34b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5726, "upload_time": "2018-06-03T07:56:21", "url": "https://files.pythonhosted.org/packages/39/52/220c3741ff7af2b72faae7dee2018288bd63b96951818a2d269ede6bb83a/CppUMockify-0.0.6.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d6e4064e14a1fdc6ec6135885354b34b", "sha256": "85b43919e6beca5b7d6dd010ffb0e8059ed176d9095f1da6b8d8e38eeb8fc17b" }, "downloads": -1, "filename": "CppUMockify-0.0.6.tar.gz", "has_sig": false, "md5_digest": "d6e4064e14a1fdc6ec6135885354b34b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5726, "upload_time": "2018-06-03T07:56:21", "url": "https://files.pythonhosted.org/packages/39/52/220c3741ff7af2b72faae7dee2018288bd63b96951818a2d269ede6bb83a/CppUMockify-0.0.6.tar.gz" } ] }