Bug 1037532 - "mozversion should have documentation on how to use its API". r=wlachance
authorArnav Sharma <arnav.pokemonfan@gmail.com>
Wed, 16 Jul 2014 12:56:00 +0200
changeset 216588 8f38755465a3b1d3f9586cb036ee78c1ad95c60f
parent 216587 9747c285620e4f7f3a8ed7e78ff126a220cb2783
child 216589 d616c707051844a0740a2d1d49f65324be5bd6ad
push id515
push userraliiev@mozilla.com
push dateMon, 06 Oct 2014 12:51:51 +0000
treeherdermozilla-release@267c7a481bef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerswlachance
bugs1037532
milestone33.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1037532 - "mozversion should have documentation on how to use its API". r=wlachance
testing/mozbase/docs/mozversion.rst
--- a/testing/mozbase/docs/mozversion.rst
+++ b/testing/mozbase/docs/mozversion.rst
@@ -7,16 +7,37 @@ that it has been built from. This is com
 conditional logic based on the application under test.
 
 API Usage
 ---------
 
 .. automodule:: mozversion
     :members: get_version
 
+Examples
+````````
+
+Firefox::
+
+    import mozversion
+
+    version = mozversion.get_version(binary='/path/to/firefox-bin')
+    for (key, value) in sorted(version.items()):
+        if value:
+            print '%s: %s' % (key, value)
+
+Firefox for Android::
+
+    version = mozversion.get_version(binary='path/to/firefox.apk')
+    print version['application_changeset'] # gets hg revision of build
+
+FirefoxOS::
+
+    version = mozversion.get_version(sources='path/to/sources.xml', dm_type='adb')
+    print version['gaia_changeset'] # gets gaia git revision
 
 Command Line Usage
 ------------------
 
 mozversion comes with a command line program, ``mozversion`` which may be used to
 get version information from an application.
 
 Usage::