Commit Graph

27 Commits

Author SHA1 Message Date
Jackie Huang 5528cd5c0f ptest.bbclass: use BPN in PTEST_PATH for multilib
Use BPN instead of PN in PTEST_PATH for multilib builds,
or we get two directories for a package in libdir which
doesn't make sense, e.g.

$ ls /usr/lib/*coreutils
/usr/lib/coreutils:
libstdbuf.so

/usr/lib/lib32-coreutils:
ptest

(From OE-Core rev: 0e949b7bfc4207aba0e3c4d12b76cc1f1815470d)

Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-04 23:18:19 +00:00
Joshua Lock c4e2c59088 meta: remove True option to getVar calls
getVar() now defaults to expanding by default, thus remove the True
option from getVar() calls with a regex search and replace.

Search made with the following regex: getVar ?\(( ?[^,()]*), True\)

(From OE-Core rev: 7c552996597faaee2fbee185b250c0ee30ea3b5f)

Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-16 10:23:23 +00:00
Richard Purdie fecb07755c classes: Ensure pass setVar/setVarFlag strings, not integers
This doesn't cause any issues right now but it make sense to standardise
on consistently using strings in the data store.

(From OE-Core rev: 99203fbe5ad470ef65cff93cec9d7f332883b5ee)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-11-24 15:50:26 +00:00
Ian Ray e4a496102d ptest: run-ptest not required to run do_install_ptest
Modify do_install_ptest_base to run do_install_ptest and install the
Makefile irrespective of the presence of ${WORKDIR}/run-ptest.  This
change allows "ptest-aware" packages to install run-ptest as part of
the make machinery.

(From OE-Core rev: 2055517d91e0c55ed108d3a6f52abd1d2c6824b2)

Signed-off-by: Ian Ray <ian.ray@ge.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-01 15:07:48 +01:00
Ross Burton 9cda8f782f Revert "ptest: use fakeroot for do_install_ptest_base"
This reverts commit 56c5fa106eeccda2ca92dbeb73ff01ba40992e7d.

(This fix was incorrect and there is a better fix due to be merged)

(From OE-Core rev: 21e044d92e927639a574c43cf7778e31f2e66377)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-12 22:48:46 +01:00
Ross Burton a2ec6d4720 ptest: fix file ownerships in ${PTEST_PATH}
As most upstreams don't have installable test suites it's fairly common to copy
files directly out of a source tree for ptests, but this results in files in the
recipe being owned by the user running bitbake:

  WARNING: QA Issue: .../sed/4.2.2-r0/packages-split/sed-ptest/usr/lib64/
  sed/ptest/testsuite/bug-regex21 is owned by uid 1000, which is the same
  as the user running bitbake. This may be due to host contamination
  [host-user-contaminated]

Instead of needing to fix this in every recipe that has this problem simply
chown the files to root:root in do_install_ptest_base.

(From OE-Core rev: 552daf60c58784c8f1acc12c5a443a44a922f743)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-12 22:48:34 +01:00
Ross Burton dae69e6dcf ptest: use fakeroot for do_install_ptest_base
The do_install_ptest_base task wasn't running in the fakeroot environment so
files installed by do_install_ptest were often not owned by root:root but the
user running the builds.

(From OE-Core rev: 56c5fa106eeccda2ca92dbeb73ff01ba40992e7d)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-09 14:27:55 +01:00
Ross Burton c5c80d9edc ptest: add dirs flag to ptest tasks
The ptest configure/compile/install tasks mirror the base
configure/compile/install tasks, so add an explicit dirs flag to ensure they
mkdir() and chdir() the right directory.

(From OE-Core rev: 2b407176091c5a8697260c79f7559c933f38c317)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-16 15:09:21 +01:00
Ross Burton 87de892d68 ptest: add recommends to ptest-runner
If you're installing ptest packages into an image there's a good chance
you want to run the tests.  Assist with this by recommending
ptest-runner in the -ptest packages.

(From OE-Core rev: a9eededcb33b2ee41a061298610126436dfc2c11)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-27 15:34:59 +01:00
Richard Purdie a2e612c776 ptest: Work from PTEST_ENABLED, not DISTRO_FEATURES
Some classes of recipe disable ptest even though its in DISTRO_FEATURES
(e.g. nativesdk). We shouldn't attempt to build ptest packages when
its disabled. This replaces some DISTRO_FEATURE checks with PTEST_ENABLED
checks instead.

(From OE-Core rev: 8b14fcc62f31bbbb231790136cdb984db96d9ba9)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-05-08 13:00:33 +01:00
Otavio Salvador 4c14b09498 Globally replace 'base_contains' calls with 'bb.utils.contains'
The base_contains is kept as a compatibility method and we ought to
not use it in OE-Core so we can remove it from base metadata in
future.

(From OE-Core rev: d83b16dbf0862be387f84228710cb165c6d2b03b)

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-04-25 17:19:19 +01:00
Tudor Florea 1db8eb47b8 ptest: Don't enable ptest for nativesdk and cross-canadian packages
The ptest is useful in context of deployment to the target hence
we don't need ptest for nativesdk and cross-canadian packages

(From OE-Core rev: c0c96df9f6d571b6d1e26013822375942003e3b9)

Signed-off-by: Tudor Florea <tudor.florea@enea.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-11 08:11:40 -07:00
Richard Purdie 4db39d233c meta/recipes: Remove virtclass references
The virtclass overrides will go away at some point (apart from the multilib one).
Change them all to class-xxx instead since people enjoy copy and pasting them.

(From OE-Core rev: d1c073d2813bd913617990cd047507353ea0c09e)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-13 11:41:21 +00:00
Richard Purdie 8699cd4f61 ptest: d.keys() is slow, use a list instead
Unfortunately d.keys is extremely slow. Using a list in this case should be
fine since the addtask lines are immediately above the code and aren't
going to change often.

(From OE-Core rev: 5901189f0442cefc4d17623547f7358ffc2d37a6)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-01-14 17:03:54 +00:00
Nathan Rossi ad6f3ea1b4 ptest.bblass: Fix package QA issues when disabled
When the ptest distro feature is disabled, a ptest directory is still
created in the install phase, This directory is not cleaned up or
consumed by any package and will throw a QA error, e.g.

ERROR: QA Issue: glib-2.0: Files/directories were installed but not
shipped
  /usr/lib/glib-2.0/ptest
ERROR: QA run found fatal errors. Please consider fixing them.
ERROR: Function failed: do_package_qa

This is caused by the do_install_ptest_base[cleandirs] attribute which
is not setup to be conditional on ptest being enabled.

This patch refactors the use of PTEST_ENABLED in the *ptest_base tasks,
replacing the conditional execution with the removal of the tasks from
the build, this prevents any part (including cleandirs) of the ptest
tasks from executing when disabled.

(From OE-Core rev: def21f3f0bedae51651f1f0fc58b62b8aaaf37ae)

Signed-off-by: Nathan Rossi <nathan.rossi@xilinx.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-01-14 11:33:51 +00:00
Richard Purdie d32d08fd48 ptest: Disable for native recipes
We don't use or otherwise care about ptest for native recipes. Its therefore
pointless to take the performance hit for them and we can disable them.

(From OE-Core rev: f3d35bb4719d0b8f8e6fc5976e9dbfc0e2019c2e)

(From OE-Core rev: 16dd4cd5564a19b0a221661205430e01c35673af)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-12-20 12:26:26 +00:00
Richard Purdie f857b62b8a ptest: Fix dependency/ordering issue
We've seen occasional issues on the autobuilder where files appear during
do_populate_sysroot and this is due to the ptest installation happening
in parallel. This fixes the order to be deterministic.

(From OE-Core rev: 0ed1641d870f4bb5735aeeb7bd29cc196e61b7cc)

(From OE-Core rev: 96aa9bf8880088c9a710c86cc8ee106138152a98)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-12-20 12:26:26 +00:00
Ross Burton b4b1c90bcf ptest: ensure do_install_ptest_base task runs in fakeroot context
As this task is installing files into $D it needs to run inside pseudo so that
special permissions and owners are preserved.

(From OE-Core rev: 64f0a0bc408d8e32d5e795aeb9fffee0539f5e22)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-12-03 17:45:53 +00:00
Paul Eggleton 52a3c78719 classes/ptest: do not set EXCLUDE_FROM_WORLD
Various normal recipes that we expect to build during a world build now
inherit this class; it cannot therefore set EXCLUDE_FROM_WORLD.

(From OE-Core rev: 80f29b04b1d0a9357f193085224ccf2bf8f530fa)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-10-30 17:33:12 +00:00
Paul Eggleton 72d0504574 classes/ptest: fix quoting
BitBake currently allows using the same quotes outside and inside the
value, but it isn't really right, looks odd and might stop working in
future.

(From OE-Core rev: 0af9cf31851896276a219170001047406f45de50)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-10-30 17:33:11 +00:00
Chen Qi 8d82eae8fd ptest.bbclass: add cleandirs flag to do_install_ptest_base
The do_install_ptest_base task should have cleandirs flag, just like
the do_install task. The ${D}${PTEST_PATH} directory should be cleaned,
Otherwise, there would be similar errors like below if the
do_install_ptest_base task is rerun.

    ln: failed to create symbolic link `xxx': File exists

[YOCTO #5129]

(From OE-Core rev: 25885d3b4f679c33a514d858bc20b0e21aa63721)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-10 15:57:19 +01:00
Chen Qi 8905f7715d ptest.bbclass: fix error on ubuntu host
The do_install_ptest_base function uses 'type -t' command to check
whether do_install_ptest is a function and acts correspondingly.

However, the 'type' command is a shell builtin and its behavior is
not all the same across Linux distros. On ubuntu, if we use #!/bin/sh
as the interpreter for the scripts, as in the case of our intermediate
scripts, the '-t' option for the 'type' command is not supported. So
the check always fails and the do_install_ptest function, even if defined,
is not run.

The same problem also applies to the do_configure_ptest_base and the
do_compile_ptest_base functions.

This patch fixes this problem by avoiding using the 'type' builtin command.

[YOCTO #5128]

(From OE-Core rev: d5a4f031b460437e9501e4e65194ce94d3641130)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-10 15:57:19 +01:00
Björn Stenberg 44120a053c ptest bug fixes
Move ${PN}-ptest to start of PACKAGES to ensure all ptest files are
packaged in the -ptest package.

Add QA exclusions to insane.bbclass to ensure -ptest packages can contain
any files they need.

Disable ptest for native packages.

Don't emit errors on missing _ptest functions.

(From OE-Core rev: 01bea4ef932e46eb2fcc8b4be7ff5e2b5b2a0978)

Signed-off-by: Björn Stenberg <bjst@enea.com>
Signed-off-by: Anders Roxell <anders.roxell@enea.com>
Signed-off-by: Josep Puigdemont <josep.puigdemont@enea.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-04-11 12:20:35 +01:00
Björn Stenberg bb498369b8 ptest: Move ptest checks from recipes to ptest.bbclass
This patch cleans up ptest implementation in recipes by moving ptest
specific code parts into dedicated *_ptest functions.

(From OE-Core rev: 1e4d267a3cbd2135a5de10519814087050b766b7)

Signed-off-by: Björn Stenberg <bjst@enea.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-07 11:14:39 +00:00
Björn Stenberg c1aef57e20 ptest: Add missed .debug path
(From OE-Core rev: f8bf3c65327c6e04c19a7dda623c7433f5d97417)

Signed-off-by: Björn Stenberg <bjst@enea.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-22 06:09:22 -08:00
Christopher Larson 89031c2651 ptest.bbclass: don't add to PACKAGES if disabled
Without this, we have excessive dependencies leaking into the build. In
particular, glib-2.0 was sucking in python modules even if ptest wasn't in
DISTRO_FEATURES.

(From OE-Core rev: 7bf5ee91aa84a6fa85d6da361b64139889faa172)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-01-18 13:28:04 +00:00
Björn Stenberg 1d2c6833ae Add a new distro feature "ptest".
This patch creates a new distro feature "ptest", which creates -ptest
packages containing the test suite of the package for running on the
target. Test files are installed in /usr/lib/<pkg>/ptest.

The patch also includes a change to automake, splitting the "make check"
target into separate steps for building and running the tests.

(From OE-Core rev: 6f92e7f8891008dd3c89325d3fbe2da853372326)

Signed-off-by: Björn Stenberg <bjst@enea.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-12-26 11:34:04 +00:00