DevGuide.md revision 13481
111986Sandreas.sandberg@arm.com
211986Sandreas.sandberg@arm.com
311986Sandreas.sandberg@arm.comIf you are interested in understanding the internals of Google Mock,
411986Sandreas.sandberg@arm.combuilding from source, or contributing ideas or modifications to the
511986Sandreas.sandberg@arm.comproject, then this document is for you.
611986Sandreas.sandberg@arm.com
711986Sandreas.sandberg@arm.com# Introduction #
811986Sandreas.sandberg@arm.com
911986Sandreas.sandberg@arm.comFirst, let's give you some background of the project.
1011986Sandreas.sandberg@arm.com
1111986Sandreas.sandberg@arm.com## Licensing ##
1211986Sandreas.sandberg@arm.com
1311986Sandreas.sandberg@arm.comAll Google Mock source and pre-built packages are provided under the [New BSD License](http://www.opensource.org/licenses/bsd-license.php).
1411986Sandreas.sandberg@arm.com
1511986Sandreas.sandberg@arm.com## The Google Mock Community ##
1611986Sandreas.sandberg@arm.com
1711986Sandreas.sandberg@arm.comThe Google Mock community exists primarily through the [discussion group](http://groups.google.com/group/googlemock), the
1811986Sandreas.sandberg@arm.com[issue tracker](https://github.com/google/googletest/issues) and, to a lesser extent, the [source control repository](../). You are definitely encouraged to contribute to the
1911986Sandreas.sandberg@arm.comdiscussion and you can also help us to keep the effectiveness of the
2011986Sandreas.sandberg@arm.comgroup high by following and promoting the guidelines listed here.
2111986Sandreas.sandberg@arm.com
2211986Sandreas.sandberg@arm.com### Please Be Friendly ###
2311986Sandreas.sandberg@arm.com
2411986Sandreas.sandberg@arm.comShowing courtesy and respect to others is a vital part of the Google
2511986Sandreas.sandberg@arm.comculture, and we strongly encourage everyone participating in Google
2611986Sandreas.sandberg@arm.comMock development to join us in accepting nothing less. Of course,
2711986Sandreas.sandberg@arm.combeing courteous is not the same as failing to constructively disagree
2811986Sandreas.sandberg@arm.comwith each other, but it does mean that we should be respectful of each
2911986Sandreas.sandberg@arm.comother when enumerating the 42 technical reasons that a particular
3011986Sandreas.sandberg@arm.comproposal may not be the best choice. There's never a reason to be
3111986Sandreas.sandberg@arm.comantagonistic or dismissive toward anyone who is sincerely trying to
3211986Sandreas.sandberg@arm.comcontribute to a discussion.
3311986Sandreas.sandberg@arm.com
3411986Sandreas.sandberg@arm.comSure, C++ testing is serious business and all that, but it's also
3511986Sandreas.sandberg@arm.coma lot of fun. Let's keep it that way. Let's strive to be one of the
3611986Sandreas.sandberg@arm.comfriendliest communities in all of open source.
3711986Sandreas.sandberg@arm.com
3811986Sandreas.sandberg@arm.com### Where to Discuss Google Mock ###
3911986Sandreas.sandberg@arm.com
4011986Sandreas.sandberg@arm.comAs always, discuss Google Mock in the official [Google C++ Mocking Framework discussion group](http://groups.google.com/group/googlemock).  You don't have to actually submit
4111986Sandreas.sandberg@arm.comcode in order to sign up. Your participation itself is a valuable
4211986Sandreas.sandberg@arm.comcontribution.
4311986Sandreas.sandberg@arm.com
4411986Sandreas.sandberg@arm.com# Working with the Code #
4511986Sandreas.sandberg@arm.com
4611986Sandreas.sandberg@arm.comIf you want to get your hands dirty with the code inside Google Mock,
4711986Sandreas.sandberg@arm.comthis is the section for you.
4812391Sjason@lowepower.com
4914299Sbbruce@ucdavis.edu## Checking Out the Source from Subversion ##
5011986Sandreas.sandberg@arm.com
5111986Sandreas.sandberg@arm.comChecking out the Google Mock source is most useful if you plan to
5214299Sbbruce@ucdavis.edutweak it yourself.  You check out the source for Google Mock using a
5311986Sandreas.sandberg@arm.com[Subversion](http://subversion.tigris.org/) client as you would for any
5411986Sandreas.sandberg@arm.comother project hosted on Google Code.  Please see the instruction on
5511986Sandreas.sandberg@arm.comthe [source code access page](../) for how to do it.
5611986Sandreas.sandberg@arm.com
5711986Sandreas.sandberg@arm.com## Compiling from Source ##
5811986Sandreas.sandberg@arm.com
5911986Sandreas.sandberg@arm.comOnce you check out the code, you can find instructions on how to
6011986Sandreas.sandberg@arm.comcompile it in the [README](../README.md) file.
6111986Sandreas.sandberg@arm.com
6211986Sandreas.sandberg@arm.com## Testing ##
6311986Sandreas.sandberg@arm.com
6411986Sandreas.sandberg@arm.comA mocking framework is of no good if itself is not thoroughly tested.
6511986Sandreas.sandberg@arm.comTests should be written for any new code, and changes should be
6611986Sandreas.sandberg@arm.comverified to not break existing tests before they are submitted for
6711986Sandreas.sandberg@arm.comreview. To perform the tests, follow the instructions in [README](http://code.google.com/p/googlemock/source/browse/trunk/README) and
6811986Sandreas.sandberg@arm.comverify that there are no failures.
6911986Sandreas.sandberg@arm.com
7011986Sandreas.sandberg@arm.com# Contributing Code #
7111986Sandreas.sandberg@arm.com
7211986Sandreas.sandberg@arm.comWe are excited that Google Mock is now open source, and hope to get
7311986Sandreas.sandberg@arm.comgreat patches from the community. Before you fire up your favorite IDE
7411986Sandreas.sandberg@arm.comand begin hammering away at that new feature, though, please take the
7511986Sandreas.sandberg@arm.comtime to read this section and understand the process. While it seems
7611986Sandreas.sandberg@arm.comrigorous, we want to keep a high standard of quality in the code
7712037Sandreas.sandberg@arm.combase.
7811986Sandreas.sandberg@arm.com
7911986Sandreas.sandberg@arm.com## Contributor License Agreements ##
8011986Sandreas.sandberg@arm.com
8111986Sandreas.sandberg@arm.comYou must sign a Contributor License Agreement (CLA) before we can
8211986Sandreas.sandberg@arm.comaccept any code.  The CLA protects you and us.
8314299Sbbruce@ucdavis.edu
8414299Sbbruce@ucdavis.edu  * If you are an individual writing original source code and you're sure you own the intellectual property, then you'll need to sign an [individual CLA](http://code.google.com/legal/individual-cla-v1.0.html).
8514299Sbbruce@ucdavis.edu  * If you work for a company that wants to allow you to contribute your work to Google Mock, then you'll need to sign a [corporate CLA](http://code.google.com/legal/corporate-cla-v1.0.html).
8614299Sbbruce@ucdavis.edu
8711986Sandreas.sandberg@arm.comFollow either of the two links above to access the appropriate CLA and
8812391Sjason@lowepower.cominstructions for how to sign and return it.
8912037Sandreas.sandberg@arm.com
9011986Sandreas.sandberg@arm.com## Coding Style ##
9111986Sandreas.sandberg@arm.com
9211986Sandreas.sandberg@arm.comTo keep the source consistent, readable, diffable and easy to merge,
9311986Sandreas.sandberg@arm.comwe use a fairly rigid coding style, as defined by the [google-styleguide](https://github.com/google/styleguide) project.  All patches will be expected
9411986Sandreas.sandberg@arm.comto conform to the style outlined [here](https://github.com/google/styleguide/blob/gh-pages/cppguide.xml).
9514299Sbbruce@ucdavis.edu
9611986Sandreas.sandberg@arm.com## Submitting Patches ##
9712391Sjason@lowepower.com
9814299Sbbruce@ucdavis.eduPlease do submit code. Here's what you need to do:
9911986Sandreas.sandberg@arm.com
10011986Sandreas.sandberg@arm.com  1. Normally you should make your change against the SVN trunk instead of a branch or a tag, as the latter two are for release control and should be treated mostly as read-only.
10111986Sandreas.sandberg@arm.com  1. Decide which code you want to submit. A submission should be a set of changes that addresses one issue in the [Google Mock issue tracker](http://code.google.com/p/googlemock/issues/list). Please don't mix more than one logical change per submittal, because it makes the history hard to follow. If you want to make a change that doesn't have a corresponding issue in the issue tracker, please create one.
10214299Sbbruce@ucdavis.edu  1. Also, coordinate with team members that are listed on the issue in question. This ensures that work isn't being duplicated and communicating your plan early also generally leads to better patches.
10311986Sandreas.sandberg@arm.com  1. Ensure that your code adheres to the [Google Mock source code style](#Coding_Style.md).
10411986Sandreas.sandberg@arm.com  1. Ensure that there are unit tests for your code.
10511986Sandreas.sandberg@arm.com  1. Sign a Contributor License Agreement.
10611986Sandreas.sandberg@arm.com  1. Create a patch file using `svn diff`.
10711986Sandreas.sandberg@arm.com  1. We use [Rietveld](http://codereview.appspot.com/) to do web-based code reviews.  You can read about the tool [here](https://github.com/rietveld-codereview/rietveld/wiki).  When you are ready, upload your patch via Rietveld and notify `googlemock@googlegroups.com` to review it.  There are several ways to upload the patch.  We recommend using the [upload\_gmock.py](../scripts/upload_gmock.py) script, which you can find in the `scripts/` folder in the SVN trunk.
10811986Sandreas.sandberg@arm.com
10912037Sandreas.sandberg@arm.com## Google Mock Committers ##
11011986Sandreas.sandberg@arm.com
11111986Sandreas.sandberg@arm.comThe current members of the Google Mock engineering team are the only
11211986Sandreas.sandberg@arm.comcommitters at present. In the great tradition of eating one's own
11311986Sandreas.sandberg@arm.comdogfood, we will be requiring each new Google Mock engineering team
11412037Sandreas.sandberg@arm.commember to earn the right to become a committer by following the
11512037Sandreas.sandberg@arm.comprocedures in this document, writing consistently great code, and
11612037Sandreas.sandberg@arm.comdemonstrating repeatedly that he or she truly gets the zen of Google
11714299Sbbruce@ucdavis.eduMock.
11812037Sandreas.sandberg@arm.com
11914299Sbbruce@ucdavis.edu# Release Process #
12014299Sbbruce@ucdavis.edu
12114299Sbbruce@ucdavis.eduWe follow the typical release process for Subversion-based projects:
12212037Sandreas.sandberg@arm.com
12311986Sandreas.sandberg@arm.com  1. A release branch named `release-X.Y` is created.
12412391Sjason@lowepower.com  1. Bugs are fixed and features are added in trunk; those individual patches are merged into the release branch until it's stable.
12511986Sandreas.sandberg@arm.com  1. An individual point release (the `Z` in `X.Y.Z`) is made by creating a tag from the branch.
12611986Sandreas.sandberg@arm.com  1. Repeat steps 2 and 3 throughout one release cycle (as determined by features or time).
12711986Sandreas.sandberg@arm.com  1. Go back to step 1 to create another release branch and so on.
12811986Sandreas.sandberg@arm.com
12911986Sandreas.sandberg@arm.com
13011986Sandreas.sandberg@arm.com---
13111986Sandreas.sandberg@arm.com
13211986Sandreas.sandberg@arm.comThis page is based on the [Making GWT Better](http://code.google.com/webtoolkit/makinggwtbetter.html) guide from the [Google Web Toolkit](http://code.google.com/webtoolkit/) project.  Except as otherwise [noted](http://code.google.com/policies.html#restrictions), the content of this page is licensed under the [Creative Commons Attribution 2.5 License](http://creativecommons.org/licenses/by/2.5/).
13311986Sandreas.sandberg@arm.com