summaryrefslogtreecommitdiffstats
path: root/testing/mozbase/docs/mozversion.rst
blob: a09e7cf8ecf1b7d5d234475af292c47fb5536471 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
:mod:`mozversion` --- Get application information
=================================================

`mozversion <https://hg.mozilla.org/mozilla-central/file/tip/testing/mozbase/mozversion>`_
provides version information such as the application name and the changesets
that it has been built from. This is commonly used in reporting or for
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

Command Line Usage
------------------

mozversion comes with a command line program, ``mozversion`` which may be used to
get version information from an application.

Usage::

    mozversion [options]

Options
```````

---binary
'''''''''

This is the path to the target application binary or .apk. If this is omitted
then the current directory is checked for the existence of an
application.ini file. If not found, then it is assumed the target
application is a remote Firefox OS instance.

Examples
````````

Firefox::

    $ mozversion --binary=/path/to/firefox-bin
    application_buildid: 20131205075310
    application_changeset: 39faf812aaec
    application_name: Firefox
    application_repository: http://hg.mozilla.org/releases/mozilla-release
    application_version: 26.0
    platform_buildid: 20131205075310
    platform_changeset: 39faf812aaec
    platform_repository: http://hg.mozilla.org/releases/mozilla-release

Firefox for Android::

    $ mozversion --binary=/path/to/firefox.apk