dev-manual: Edits to the ptest section.
These are review comments from both Paul and Bjorn. (From yocto-docs rev: 773300f78b20bd601cbad750cfe32263fbe9d127) Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
d1f324a2a5
commit
598089fab8
|
@ -2848,7 +2848,7 @@
|
|||
<listitem><para>Setting up Runtime Package Management
|
||||
</para></listitem>
|
||||
<listitem><para>Setting up and running package test
|
||||
(Ptest)
|
||||
(ptest)
|
||||
</para></listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
|
@ -3477,17 +3477,17 @@
|
|||
</section>
|
||||
|
||||
<section id='testing-packages-with-ptest'>
|
||||
<title>Testing Packages with Ptest</title>
|
||||
<title>Testing Packages with ptest</title>
|
||||
|
||||
<para>
|
||||
A Packate Test (Ptest) runs tests against packages built
|
||||
by the OpenEmbedded build system.
|
||||
Minimaly, a Ptest contains two things: a shell script that
|
||||
A Package Test (ptest) runs tests against packages built
|
||||
by the OpenEmbedded build system on the target machine.
|
||||
Minimally, a Ptest contains two things: a shell script that
|
||||
starts the test, and the actual test.
|
||||
The shell that starts the test must not contain
|
||||
The shell script that starts the test must not contain
|
||||
the actual test, the script only starts it.
|
||||
On the other hand, the test can be anything from a simple
|
||||
schell script that runs a binary and checks the output to
|
||||
shell script that runs a binary and checks the output to
|
||||
an elaborate system of test binaries and data files.
|
||||
</para>
|
||||
|
||||
|
@ -3513,8 +3513,8 @@
|
|||
you want to test.
|
||||
Here is what you have to do for each recipe:
|
||||
<itemizedlist>
|
||||
<listitem><para><emphasis>Be sure the package recipe
|
||||
inherits Ptest:</emphasis>
|
||||
<listitem><para><emphasis>Be sure the recipe
|
||||
inherits ptest:</emphasis>
|
||||
Include the following line in your recipes:
|
||||
<literallayout class='monospaced'>
|
||||
inherit ptest
|
||||
|
@ -3552,14 +3552,15 @@
|
|||
The built version of Automake that ships with
|
||||
the Yocto Project separates these actions
|
||||
automatically through a patch.
|
||||
Consequently, packages that use
|
||||
Consequently, packages that use the unaltered
|
||||
patched version of
|
||||
<filename>make check</filename> automatically
|
||||
cross-compile.</para>
|
||||
<para>However, you still must add a
|
||||
<filename>do_compile_ptest</filename> function to
|
||||
build the test suite.
|
||||
Add a function similar to the following to your
|
||||
package recipe:
|
||||
recipe:
|
||||
<literallayout class='monospaced'>
|
||||
do_compile_ptest() {
|
||||
oe_runmake buildtest-TESTS
|
||||
|
@ -3576,10 +3577,10 @@
|
|||
<listitem><para><emphasis>Install the test
|
||||
suite:</emphasis>
|
||||
The <filename>ptest.bbclass</filename> class
|
||||
automatically copies the required files that both
|
||||
"make" (assuming there is a make target in the
|
||||
top-level <filename>Makefile</filename>) and run
|
||||
the tests.
|
||||
automatically copies the file
|
||||
<filename>run-ptest</filename> to the target and
|
||||
then runs <filename>make install-ptest</filename>
|
||||
to run the tests.
|
||||
If this is not the case, you need to create a
|
||||
<filename>do_install_ptest</filename> that gets
|
||||
called after the "make install-ptest" completes.
|
||||
|
@ -3589,26 +3590,29 @@
|
|||
</section>
|
||||
|
||||
<section id='adding-ptest-to-your-build'>
|
||||
<title>Adding Ptest to Your Build</title>
|
||||
<title>Adding ptest to Your Build</title>
|
||||
|
||||
<para>
|
||||
To add package testing to your build, add the following
|
||||
two statements to your <filename>local.conf</filename> file,
|
||||
To add package testing to your build, add the
|
||||
<ulink url='&YOCTO_DOCS_REF_URL;#DISTRO_FEATURES'><filename>DISTRO_FEATURES</filename></ulink>
|
||||
and <ulink url='&YOCTO_DOCS_REF_URL;#EXTRA_IMAGE_FEATURES'><filename>EXTRA_IMAGE_FEATURES</filename></ulink>
|
||||
variables to your <filename>local.conf</filename> file,
|
||||
which is found in the
|
||||
<link linkend='build-directory'>Build Directory</link>:
|
||||
<literallayout class='monospaced'>
|
||||
DISTRO_FEATURES += "ptest"
|
||||
IMAGE_FEATURES += "ptest"
|
||||
DISTRO_FEATURES = "ptest-pkgs"
|
||||
EXTRA_IMAGE_FEATURES = "ptest"
|
||||
</literallayout>
|
||||
Once your build is complete, the Ptest files are installed
|
||||
Once your build is complete, the ptest files are installed
|
||||
into the <filename>/usr/lib/<package>/ptest</filename>
|
||||
directory, where <filename><package></filename>
|
||||
is the name of the package.
|
||||
directory within the image, where
|
||||
<filename><package></filename> is the name of the
|
||||
package.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id='running-ptest'>
|
||||
<title>Running Ptest</title>
|
||||
<title>Running ptest</title>
|
||||
|
||||
<para>
|
||||
The <filename>ptest-runner</filename> package installs a
|
||||
|
|
Loading…
Reference in New Issue