[ab4fdfc] | 1 | <?xml version="1.0" encoding="UTF-8"?>
|
---|
[3609a85] | 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
| 4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 |
|
---|
| 7 | <!ENTITY umockdev-download-http "https://github.com/martinpitt/umockdev/releases/download/&umockdev-version;/umockdev-&umockdev-version;.tar.xz">
|
---|
| 8 | <!ENTITY umockdev-download-ftp " ">
|
---|
[561987f3] | 9 | <!ENTITY umockdev-md5sum "74342306a6d25e266dfa2a7b7695c2e1">
|
---|
[1ff58970] | 10 | <!ENTITY umockdev-size "484 KB">
|
---|
[561987f3] | 11 | <!ENTITY umockdev-buildsize "6.8 MB (with tests)">
|
---|
[8064055b] | 12 | <!ENTITY umockdev-time "0.1 SBU (with tests)">
|
---|
[3609a85] | 13 | ]>
|
---|
| 14 |
|
---|
| 15 | <sect1 id="umockdev" xreflabel="umockdev-&umockdev-version;">
|
---|
| 16 | <?dbhtml filename="umockdev.html"?>
|
---|
| 17 |
|
---|
| 18 |
|
---|
| 19 | <title>Umockdev-&umockdev-version;</title>
|
---|
| 20 |
|
---|
| 21 | <indexterm zone="umockdev">
|
---|
| 22 | <primary sortas="a-umockdev">umockdev</primary>
|
---|
| 23 | </indexterm>
|
---|
| 24 |
|
---|
| 25 | <sect2 role="package">
|
---|
| 26 | <title>Introduction to Umockdev</title>
|
---|
| 27 |
|
---|
| 28 | <para>
|
---|
| 29 | The <application>Umockdev</application> package contains a framework
|
---|
| 30 | that allows a developer to mock devices for use in unit testing.
|
---|
| 31 | </para>
|
---|
| 32 |
|
---|
[e8b3f50] | 33 | &lfs121_checked;
|
---|
[3609a85] | 34 |
|
---|
| 35 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
| 36 | <itemizedlist spacing="compact">
|
---|
| 37 | <listitem>
|
---|
| 38 | <para>
|
---|
| 39 | Download (HTTP): <ulink url="&umockdev-download-http;"/>
|
---|
| 40 | </para>
|
---|
| 41 | </listitem>
|
---|
| 42 | <listitem>
|
---|
| 43 | <para>
|
---|
| 44 | Download (FTP): <ulink url="&umockdev-download-ftp;"/>
|
---|
| 45 | </para>
|
---|
| 46 | </listitem>
|
---|
| 47 | <listitem>
|
---|
| 48 | <para>
|
---|
| 49 | Download MD5 sum: &umockdev-md5sum;
|
---|
| 50 | </para>
|
---|
| 51 | </listitem>
|
---|
| 52 | <listitem>
|
---|
| 53 | <para>
|
---|
| 54 | Download size: &umockdev-size;
|
---|
| 55 | </para>
|
---|
| 56 | </listitem>
|
---|
| 57 | <listitem>
|
---|
| 58 | <para>
|
---|
| 59 | Estimated disk space required: &umockdev-buildsize;
|
---|
| 60 | </para>
|
---|
| 61 | </listitem>
|
---|
| 62 | <listitem>
|
---|
| 63 | <para>
|
---|
| 64 | Estimated build time: &umockdev-time;
|
---|
| 65 | </para>
|
---|
| 66 | </listitem>
|
---|
| 67 | </itemizedlist>
|
---|
| 68 |
|
---|
| 69 | <bridgehead renderas="sect3">Umockdev Dependencies</bridgehead>
|
---|
| 70 |
|
---|
| 71 | <bridgehead renderas="sect4">Required</bridgehead>
|
---|
| 72 | <para role="required">
|
---|
[a8089a2] | 73 | <xref linkend="libgudev"/>,
|
---|
| 74 | <xref linkend="libpcap"/>, and
|
---|
[3609a85] | 75 | <xref linkend="vala"/>
|
---|
| 76 | </para>
|
---|
| 77 |
|
---|
| 78 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
| 79 | <para role="optional">
|
---|
[14ff5ee0] | 80 | <xref linkend="gtk-doc"/> and
|
---|
[3609a85] | 81 | <ulink url="http://www.gphoto.org/">libgphoto2</ulink> (optional for tests)
|
---|
| 82 | </para>
|
---|
| 83 |
|
---|
| 84 | </sect2>
|
---|
| 85 |
|
---|
| 86 | <sect2 role="installation">
|
---|
| 87 | <title>Installation of Umockdev</title>
|
---|
| 88 |
|
---|
| 89 | <para>
|
---|
| 90 | Install <application>Umockdev</application> by running the following
|
---|
| 91 | commands:
|
---|
| 92 | </para>
|
---|
| 93 |
|
---|
[8558044] | 94 | <screen><userinput>mkdir build &&
|
---|
[14ff5ee0] | 95 | cd build &&
|
---|
| 96 |
|
---|
[91318eb] | 97 | meson setup --prefix=/usr --buildtype=release .. &&
|
---|
[14ff5ee0] | 98 | ninja</userinput></screen>
|
---|
[3609a85] | 99 |
|
---|
| 100 | <para>
|
---|
[561987f3] | 101 | To test the results, issue as the &root; user:: <command>ninja test</command>.
|
---|
| 102 | One test needs to be run in an X session.
|
---|
[3609a85] | 103 | </para>
|
---|
| 104 |
|
---|
| 105 | <para>
|
---|
[561987f3] | 106 | Now, as the &root; user:
|
---|
[3609a85] | 107 | </para>
|
---|
| 108 |
|
---|
[14ff5ee0] | 109 | <screen role="root"><userinput>ninja install</userinput></screen>
|
---|
[3609a85] | 110 | </sect2>
|
---|
| 111 |
|
---|
| 112 | <sect2 role="commands">
|
---|
| 113 | <title>Command Explanations</title>
|
---|
| 114 |
|
---|
[14ff5ee0] | 115 | <para>
|
---|
| 116 | <option>-Dgtk_doc=true</option>: Use this switch if you have
|
---|
| 117 | <xref linkend="gtk-doc" role="nodep"/> installed and wish to rebuild and
|
---|
| 118 | install the API documentation.
|
---|
| 119 | </para>
|
---|
[3609a85] | 120 |
|
---|
| 121 | </sect2>
|
---|
| 122 |
|
---|
| 123 | <sect2 role="content">
|
---|
| 124 | <title>Contents</title>
|
---|
| 125 |
|
---|
| 126 | <segmentedlist>
|
---|
| 127 | <segtitle>Installed Programs</segtitle>
|
---|
| 128 | <segtitle>Installed Libraries</segtitle>
|
---|
| 129 | <segtitle>Installed Directories</segtitle>
|
---|
| 130 |
|
---|
| 131 | <seglistitem>
|
---|
| 132 | <seg>
|
---|
| 133 | umockdev-record,
|
---|
| 134 | umockdev-run, and
|
---|
| 135 | umockdev-wrapper
|
---|
| 136 | </seg>
|
---|
| 137 | <seg>
|
---|
[113f4e6] | 138 | libumockdev-preload.so <!-- Only intended for use by
|
---|
[3609a85] | 139 | umockdev-wrapper. Don't put in a short description for this--> and
|
---|
| 140 | libumockdev.so
|
---|
| 141 | </seg>
|
---|
| 142 | <seg>
|
---|
[fa2c610] | 143 | /usr/include/umockdev-1.0
|
---|
[3609a85] | 144 | </seg>
|
---|
| 145 | </seglistitem>
|
---|
| 146 | </segmentedlist>
|
---|
| 147 |
|
---|
| 148 | <variablelist>
|
---|
| 149 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 150 | <?dbfo list-presentation="list"?>
|
---|
| 151 | <?dbhtml list-presentation="table"?>
|
---|
| 152 |
|
---|
| 153 | <varlistentry id="umockdev-record">
|
---|
| 154 | <term><command>umockdev-record</command></term>
|
---|
| 155 | <listitem>
|
---|
| 156 | <para>
|
---|
| 157 | records Linux devices and their ancestors from sysfs/udev or
|
---|
[4c24eb0a] | 158 | records ioctls for a device
|
---|
[3609a85] | 159 | </para>
|
---|
| 160 | <indexterm zone="umockdev umockdev-record">
|
---|
| 161 | <primary sortas="b-umockdev-record">umockdev-record</primary>
|
---|
| 162 | </indexterm>
|
---|
| 163 | </listitem>
|
---|
| 164 | </varlistentry>
|
---|
| 165 |
|
---|
| 166 | <varlistentry id="umockdev-run">
|
---|
| 167 | <term><command>umockdev-run</command></term>
|
---|
| 168 | <listitem>
|
---|
| 169 | <para>
|
---|
| 170 | runs a program under an <application>umockdev</application>
|
---|
[4c24eb0a] | 171 | testbed
|
---|
[3609a85] | 172 | </para>
|
---|
| 173 | <indexterm zone="umockdev umockdev-run">
|
---|
| 174 | <primary sortas="b-umockdev-run">umockdev-run</primary>
|
---|
| 175 | </indexterm>
|
---|
| 176 | </listitem>
|
---|
| 177 | </varlistentry>
|
---|
| 178 |
|
---|
| 179 | <varlistentry id="umockdev-wrapper">
|
---|
| 180 | <term><command>umockdev-wrapper</command></term>
|
---|
| 181 | <listitem>
|
---|
| 182 | <para>
|
---|
[8558044] | 183 | wraps a program around
|
---|
[3609a85] | 184 | <filename class="libraryfile">libumockdev-preload.so.0</filename>
|
---|
[4c24eb0a] | 185 | through LD_PRELOAD
|
---|
[3609a85] | 186 | </para>
|
---|
| 187 | <indexterm zone="umockdev umockdev-wrapper">
|
---|
| 188 | <primary sortas="b-umockdev-wrapper">umockdev-wrapper</primary>
|
---|
| 189 | </indexterm>
|
---|
| 190 | </listitem>
|
---|
| 191 | </varlistentry>
|
---|
| 192 |
|
---|
| 193 | <varlistentry id="libumockdev">
|
---|
| 194 | <term><filename class="libraryfile">libumockdev.so</filename></term>
|
---|
| 195 | <listitem>
|
---|
| 196 | <para>
|
---|
| 197 | provides API functions that allow mocking hardware devices for unit
|
---|
[4c24eb0a] | 198 | testing
|
---|
[3609a85] | 199 | </para>
|
---|
| 200 | <indexterm zone="umockdev libumockdev">
|
---|
| 201 | <primary sortas="c-libumockdev">libumockdev.so</primary>
|
---|
| 202 | </indexterm>
|
---|
| 203 | </listitem>
|
---|
| 204 | </varlistentry>
|
---|
| 205 | </variablelist>
|
---|
| 206 | </sect2>
|
---|
[4c24eb0a] | 207 |
|
---|
[3609a85] | 208 | </sect1>
|
---|