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
|
<listitem><para>Setting up Runtime Package Management
|
||||||
</para></listitem>
|
</para></listitem>
|
||||||
<listitem><para>Setting up and running package test
|
<listitem><para>Setting up and running package test
|
||||||
(Ptest)
|
(ptest)
|
||||||
</para></listitem>
|
</para></listitem>
|
||||||
</itemizedlist>
|
</itemizedlist>
|
||||||
</para>
|
</para>
|
||||||
|
@ -3477,17 +3477,17 @@
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section id='testing-packages-with-ptest'>
|
<section id='testing-packages-with-ptest'>
|
||||||
<title>Testing Packages with Ptest</title>
|
<title>Testing Packages with ptest</title>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
A Packate Test (Ptest) runs tests against packages built
|
A Package Test (ptest) runs tests against packages built
|
||||||
by the OpenEmbedded build system.
|
by the OpenEmbedded build system on the target machine.
|
||||||
Minimaly, a Ptest contains two things: a shell script that
|
Minimally, a Ptest contains two things: a shell script that
|
||||||
starts the test, and the actual test.
|
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.
|
the actual test, the script only starts it.
|
||||||
On the other hand, the test can be anything from a simple
|
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.
|
an elaborate system of test binaries and data files.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
|
@ -3513,8 +3513,8 @@
|
||||||
you want to test.
|
you want to test.
|
||||||
Here is what you have to do for each recipe:
|
Here is what you have to do for each recipe:
|
||||||
<itemizedlist>
|
<itemizedlist>
|
||||||
<listitem><para><emphasis>Be sure the package recipe
|
<listitem><para><emphasis>Be sure the recipe
|
||||||
inherits Ptest:</emphasis>
|
inherits ptest:</emphasis>
|
||||||
Include the following line in your recipes:
|
Include the following line in your recipes:
|
||||||
<literallayout class='monospaced'>
|
<literallayout class='monospaced'>
|
||||||
inherit ptest
|
inherit ptest
|
||||||
|
@ -3552,14 +3552,15 @@
|
||||||
The built version of Automake that ships with
|
The built version of Automake that ships with
|
||||||
the Yocto Project separates these actions
|
the Yocto Project separates these actions
|
||||||
automatically through a patch.
|
automatically through a patch.
|
||||||
Consequently, packages that use
|
Consequently, packages that use the unaltered
|
||||||
|
patched version of
|
||||||
<filename>make check</filename> automatically
|
<filename>make check</filename> automatically
|
||||||
cross-compile.</para>
|
cross-compile.</para>
|
||||||
<para>However, you still must add a
|
<para>However, you still must add a
|
||||||
<filename>do_compile_ptest</filename> function to
|
<filename>do_compile_ptest</filename> function to
|
||||||
build the test suite.
|
build the test suite.
|
||||||
Add a function similar to the following to your
|
Add a function similar to the following to your
|
||||||
package recipe:
|
recipe:
|
||||||
<literallayout class='monospaced'>
|
<literallayout class='monospaced'>
|
||||||
do_compile_ptest() {
|
do_compile_ptest() {
|
||||||
oe_runmake buildtest-TESTS
|
oe_runmake buildtest-TESTS
|
||||||
|
@ -3576,10 +3577,10 @@
|
||||||
<listitem><para><emphasis>Install the test
|
<listitem><para><emphasis>Install the test
|
||||||
suite:</emphasis>
|
suite:</emphasis>
|
||||||
The <filename>ptest.bbclass</filename> class
|
The <filename>ptest.bbclass</filename> class
|
||||||
automatically copies the required files that both
|
automatically copies the file
|
||||||
"make" (assuming there is a make target in the
|
<filename>run-ptest</filename> to the target and
|
||||||
top-level <filename>Makefile</filename>) and run
|
then runs <filename>make install-ptest</filename>
|
||||||
the tests.
|
to run the tests.
|
||||||
If this is not the case, you need to create a
|
If this is not the case, you need to create a
|
||||||
<filename>do_install_ptest</filename> that gets
|
<filename>do_install_ptest</filename> that gets
|
||||||
called after the "make install-ptest" completes.
|
called after the "make install-ptest" completes.
|
||||||
|
@ -3589,26 +3590,29 @@
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section id='adding-ptest-to-your-build'>
|
<section id='adding-ptest-to-your-build'>
|
||||||
<title>Adding Ptest to Your Build</title>
|
<title>Adding ptest to Your Build</title>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
To add package testing to your build, add the following
|
To add package testing to your build, add the
|
||||||
two statements to your <filename>local.conf</filename> file,
|
<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
|
which is found in the
|
||||||
<link linkend='build-directory'>Build Directory</link>:
|
<link linkend='build-directory'>Build Directory</link>:
|
||||||
<literallayout class='monospaced'>
|
<literallayout class='monospaced'>
|
||||||
DISTRO_FEATURES += "ptest"
|
DISTRO_FEATURES = "ptest-pkgs"
|
||||||
IMAGE_FEATURES += "ptest"
|
EXTRA_IMAGE_FEATURES = "ptest"
|
||||||
</literallayout>
|
</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>
|
into the <filename>/usr/lib/<package>/ptest</filename>
|
||||||
directory, where <filename><package></filename>
|
directory within the image, where
|
||||||
is the name of the package.
|
<filename><package></filename> is the name of the
|
||||||
|
package.
|
||||||
</para>
|
</para>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section id='running-ptest'>
|
<section id='running-ptest'>
|
||||||
<title>Running Ptest</title>
|
<title>Running ptest</title>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
The <filename>ptest-runner</filename> package installs a
|
The <filename>ptest-runner</filename> package installs a
|
||||||
|
|
Loading…
Reference in New Issue