[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 " ">
|
---|
[4f2fd7ac] | 9 | <!ENTITY umockdev-md5sum "1693e5e20a2e0bdaa3904a44a85a28b0">
|
---|
[1ff58970] | 10 | <!ENTITY umockdev-size "484 KB">
|
---|
[4f2fd7ac] | 11 | <!ENTITY umockdev-buildsize "6.9 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 |
|
---|
[3c9b5e9] | 33 | &lfs122_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">
|
---|
[4f2fd7ac] | 80 | <xref linkend="gtk-doc"/>,
|
---|
| 81 | <xref linkend="valgrind"/> (for tests), and
|
---|
| 82 | <ulink url="http://www.gphoto.org/">libgphoto2</ulink> (for tests)
|
---|
[3609a85] | 83 | </para>
|
---|
| 84 |
|
---|
| 85 | </sect2>
|
---|
| 86 |
|
---|
| 87 | <sect2 role="installation">
|
---|
| 88 | <title>Installation of Umockdev</title>
|
---|
| 89 |
|
---|
| 90 | <para>
|
---|
| 91 | Install <application>Umockdev</application> by running the following
|
---|
| 92 | commands:
|
---|
| 93 | </para>
|
---|
| 94 |
|
---|
[8558044] | 95 | <screen><userinput>mkdir build &&
|
---|
[14ff5ee0] | 96 | cd build &&
|
---|
| 97 |
|
---|
[91318eb] | 98 | meson setup --prefix=/usr --buildtype=release .. &&
|
---|
[14ff5ee0] | 99 | ninja</userinput></screen>
|
---|
[3609a85] | 100 |
|
---|
| 101 | <para>
|
---|
[37057ad] | 102 | To test the results, issue as the &root; user: <command>ninja test</command>.
|
---|
[561987f3] | 103 | One test needs to be run in an X session.
|
---|
[3609a85] | 104 | </para>
|
---|
| 105 |
|
---|
| 106 | <para>
|
---|
[561987f3] | 107 | Now, as the &root; user:
|
---|
[3609a85] | 108 | </para>
|
---|
| 109 |
|
---|
[14ff5ee0] | 110 | <screen role="root"><userinput>ninja install</userinput></screen>
|
---|
[3609a85] | 111 | </sect2>
|
---|
| 112 |
|
---|
| 113 | <sect2 role="commands">
|
---|
| 114 | <title>Command Explanations</title>
|
---|
| 115 |
|
---|
[14ff5ee0] | 116 | <para>
|
---|
[d6fab82] | 117 | <option>-D gtk_doc=true</option>: Use this switch if you have
|
---|
[14ff5ee0] | 118 | <xref linkend="gtk-doc" role="nodep"/> installed and wish to rebuild and
|
---|
| 119 | install the API documentation.
|
---|
| 120 | </para>
|
---|
[3609a85] | 121 |
|
---|
| 122 | </sect2>
|
---|
| 123 |
|
---|
| 124 | <sect2 role="content">
|
---|
| 125 | <title>Contents</title>
|
---|
| 126 |
|
---|
| 127 | <segmentedlist>
|
---|
| 128 | <segtitle>Installed Programs</segtitle>
|
---|
| 129 | <segtitle>Installed Libraries</segtitle>
|
---|
| 130 | <segtitle>Installed Directories</segtitle>
|
---|
| 131 |
|
---|
| 132 | <seglistitem>
|
---|
| 133 | <seg>
|
---|
| 134 | umockdev-record,
|
---|
| 135 | umockdev-run, and
|
---|
| 136 | umockdev-wrapper
|
---|
| 137 | </seg>
|
---|
| 138 | <seg>
|
---|
[113f4e6] | 139 | libumockdev-preload.so <!-- Only intended for use by
|
---|
[3609a85] | 140 | umockdev-wrapper. Don't put in a short description for this--> and
|
---|
| 141 | libumockdev.so
|
---|
| 142 | </seg>
|
---|
| 143 | <seg>
|
---|
[fa2c610] | 144 | /usr/include/umockdev-1.0
|
---|
[3609a85] | 145 | </seg>
|
---|
| 146 | </seglistitem>
|
---|
| 147 | </segmentedlist>
|
---|
| 148 |
|
---|
| 149 | <variablelist>
|
---|
| 150 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 151 | <?dbfo list-presentation="list"?>
|
---|
| 152 | <?dbhtml list-presentation="table"?>
|
---|
| 153 |
|
---|
| 154 | <varlistentry id="umockdev-record">
|
---|
| 155 | <term><command>umockdev-record</command></term>
|
---|
| 156 | <listitem>
|
---|
| 157 | <para>
|
---|
| 158 | records Linux devices and their ancestors from sysfs/udev or
|
---|
[4c24eb0a] | 159 | records ioctls for a device
|
---|
[3609a85] | 160 | </para>
|
---|
| 161 | <indexterm zone="umockdev umockdev-record">
|
---|
| 162 | <primary sortas="b-umockdev-record">umockdev-record</primary>
|
---|
| 163 | </indexterm>
|
---|
| 164 | </listitem>
|
---|
| 165 | </varlistentry>
|
---|
| 166 |
|
---|
| 167 | <varlistentry id="umockdev-run">
|
---|
| 168 | <term><command>umockdev-run</command></term>
|
---|
| 169 | <listitem>
|
---|
| 170 | <para>
|
---|
| 171 | runs a program under an <application>umockdev</application>
|
---|
[4c24eb0a] | 172 | testbed
|
---|
[3609a85] | 173 | </para>
|
---|
| 174 | <indexterm zone="umockdev umockdev-run">
|
---|
| 175 | <primary sortas="b-umockdev-run">umockdev-run</primary>
|
---|
| 176 | </indexterm>
|
---|
| 177 | </listitem>
|
---|
| 178 | </varlistentry>
|
---|
| 179 |
|
---|
| 180 | <varlistentry id="umockdev-wrapper">
|
---|
| 181 | <term><command>umockdev-wrapper</command></term>
|
---|
| 182 | <listitem>
|
---|
| 183 | <para>
|
---|
[8558044] | 184 | wraps a program around
|
---|
[3609a85] | 185 | <filename class="libraryfile">libumockdev-preload.so.0</filename>
|
---|
[4c24eb0a] | 186 | through LD_PRELOAD
|
---|
[3609a85] | 187 | </para>
|
---|
| 188 | <indexterm zone="umockdev umockdev-wrapper">
|
---|
| 189 | <primary sortas="b-umockdev-wrapper">umockdev-wrapper</primary>
|
---|
| 190 | </indexterm>
|
---|
| 191 | </listitem>
|
---|
| 192 | </varlistentry>
|
---|
| 193 |
|
---|
| 194 | <varlistentry id="libumockdev">
|
---|
| 195 | <term><filename class="libraryfile">libumockdev.so</filename></term>
|
---|
| 196 | <listitem>
|
---|
| 197 | <para>
|
---|
| 198 | provides API functions that allow mocking hardware devices for unit
|
---|
[4c24eb0a] | 199 | testing
|
---|
[3609a85] | 200 | </para>
|
---|
| 201 | <indexterm zone="umockdev libumockdev">
|
---|
| 202 | <primary sortas="c-libumockdev">libumockdev.so</primary>
|
---|
| 203 | </indexterm>
|
---|
| 204 | </listitem>
|
---|
| 205 | </varlistentry>
|
---|
| 206 | </variablelist>
|
---|
| 207 | </sect2>
|
---|
[4c24eb0a] | 208 |
|
---|
[3609a85] | 209 | </sect1>
|
---|