summaryrefslogtreecommitdiffstats
path: root/meta/classes/ptest.bbclass
Commit message (Collapse)AuthorAgeFilesLines
* ptest: append to FILESKonrad Weihmann2020-07-221-1/+1
| | | | | | | | | | | | | | as ptest FILES could be determined before or after the classes was inherited, if is much safer to append to the setting of FILES_${PN}-ptest (From OE-Core rev: 1a52f9ec394ec2ce9899543c1b9ef95e926ebf14) Signed-off-by: Konrad Weihmann <kweihmann@outlook.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 419ad35ffe7f5199e49a246ef9854f0810ca1d6c) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* ptest: Add RDEPENDS frpm PN-ptest to PN packageRichard Purdie2019-05-151-0/+1
| | | | | | | | | | | | | Many different ptests are breaking as they assume that ${PN}-ptest depends on ${PN}. It doesn't currently but should. If we fix this, many different ptests start passing when they previously failed. It does depend on fixing an issue in the dbus-test recipe which is done in the preceeding patch (mentioned in case this gets backported). (From OE-Core rev: b47194b57d94260b4e6438c5bf74914027f0b520) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* ptest.bbclass: Use d.getVar instead of os.environMariano Lopez2019-04-161-2/+2
| | | | | | | | | | [YOCTO #12597] [YOCTO #13238] (From OE-Core rev: ae116b0eea3b09055742877790b7e4620f5b8f37) Signed-off-by: Mariano Lopez <just.another.mariano@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* ptest.bbclass: Add feature to populate a binary directoryMariano Lopez2019-04-111-0/+32
| | | | | | | | | | | | | | | | | | | This adds the functionality to create a binary directory within PTEST_PATH directory. This directory will be populated with symlinks pointing to the binaries installed by the package and then renamed by update-alternatives. This way the ptest only needs to source this binary directory in order to use the expected binaries. To enable this feature just add PTEST_BINDIR = "1" to the recipe. [YOCTO #12597] [YOCTO #13238] (From OE-Core rev: bca35319b89ce668927728c4e2094f6e10cef298) Signed-off-by: Mariano Lopez <just.another.mariano@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* ptest: Optionally strip build host tool info from installed filesDouglas Royds2018-12-031-0/+5
| | | | | | | | | | | | | | | | Several packages (eg. acl, attr, openssl) install Makefiles or other build host configuration files for ptest so that they can run `make check`, for instance. These build host files commonly include paths and versions of build host tools, (eg. rpm or perl) whose presence and version depends on the build host distro. Optionally strip lines from installed PTEST_BUILD_HOST_FILES using an extended regex pattern defined in PTEST_BUILD_HOST_PATTERN. This has no effect on the on-target ptest. (From OE-Core rev: a3b657470eeea9f1954bc3a3e593a5c4907b6f17) Signed-off-by: Douglas Royds <douglas.royds@taitradio.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* ptest: Reproducibility: Strip build host paths from any installed MakefileDouglas Royds2018-12-031-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | A common pattern for ptest is to install a Makefile that provides a make check target. These generated Makefiles are normally full of build host paths, to hosttools, and to files and scripts within the source or build tree. They also commonly include the CFLAGS and CPPFLAGS. None of these build host paths can possibly work on-target, so stripping them has no effect on the success of the resulting ptests. Stripping the HOSTTOOLS_DIR has this effect, for instance: -MKDIR_P = /home/douglas/workspace/upstream/build/tmp/hosttools/mkdir -p +MKDIR_P = mkdir -p The curious WORKDIR/*= pattern avoids non-parseable -fdebug-prefix-map patterns in the CFLAGS by adding an arbitrary ".", eg: -fdebug-prefix-map=.=/usr/src/debug/rsyslog/8.37.0-r0 In all other cases, we simply remove the WORKDIR, eg: CPP = arm-tait-linux-gnueabi-gcc -E --sysroot=recipe-sysroot ... (From OE-Core rev: 137e38dbae42e9d4d413cd2f9460fb707ca77f9c) Signed-off-by: Douglas Royds <douglas.royds@taitradio.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* ptest: Reproducibility: Take control of umaskDouglas Royds2018-11-231-0/+1
| | | | | | | | | | The build host umask was leaking into the thing-ptest packages at do_install_ptest() time. (From OE-Core rev: 891343e8ba6490ca3e1876c892269b611ddc7877) Signed-off-by: Douglas Royds <douglas.royds@taitradio.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* ptest.bbclass: use BPN in PTEST_PATH for multilibJackie Huang2017-03-041-1/+1
| | | | | | | | | | | | | | | | | | | 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>
* meta: remove True option to getVar callsJoshua Lock2016-12-161-1/+1
| | | | | | | | | | | | | 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>
* classes: Ensure pass setVar/setVarFlag strings, not integersRichard Purdie2015-11-241-1/+1
| | | | | | | | | | | 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>
* ptest: run-ptest not required to run do_install_ptestIan Ray2015-10-011-5/+5
| | | | | | | | | | | | 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>
* Revert "ptest: use fakeroot for do_install_ptest_base"Ross Burton2015-09-121-1/+1
| | | | | | | | | | 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>
* ptest: fix file ownerships in ${PTEST_PATH}Ross Burton2015-09-121-0/+1
| | | | | | | | | | | | | | | | | | | 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>
* ptest: use fakeroot for do_install_ptest_baseRoss Burton2015-09-091-1/+1
| | | | | | | | | | | 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>
* ptest: add dirs flag to ptest tasksRoss Burton2015-07-161-0/+3
| | | | | | | | | | | 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>
* ptest: add recommends to ptest-runnerRoss Burton2015-04-271-0/+1
| | | | | | | | | | | 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>
* ptest: Work from PTEST_ENABLED, not DISTRO_FEATURESRichard Purdie2014-05-081-1/+1
| | | | | | | | | | | | | 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>
* Globally replace 'base_contains' calls with 'bb.utils.contains'Otavio Salvador2014-04-251-2/+2
| | | | | | | | | | | 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>
* ptest: Don't enable ptest for nativesdk and cross-canadian packagesTudor Florea2014-03-111-0/+2
| | | | | | | | | | | 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>
* meta/recipes: Remove virtclass referencesRichard Purdie2014-02-131-2/+2
| | | | | | | | | 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>
* ptest: d.keys() is slow, use a list insteadRichard Purdie2014-01-141-1/+1
| | | | | | | | | | 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>
* ptest.bblass: Fix package QA issues when disabledNathan Rossi2014-01-141-13/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* ptest: Disable for native recipesRichard Purdie2013-12-201-0/+1
| | | | | | | | | | | 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>
* ptest: Fix dependency/ordering issueRichard Purdie2013-12-201-1/+1
| | | | | | | | | | | | 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>
* ptest: ensure do_install_ptest_base task runs in fakeroot contextRoss Burton2013-12-031-0/+5
| | | | | | | | | | 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>
* classes/ptest: do not set EXCLUDE_FROM_WORLDPaul Eggleton2013-10-301-4/+0
| | | | | | | | | | 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>
* classes/ptest: fix quotingPaul Eggleton2013-10-301-1/+1
| | | | | | | | | | | 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>
* ptest.bbclass: add cleandirs flag to do_install_ptest_baseChen Qi2013-09-101-0/+2
| | | | | | | | | | | | | | | | | 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>
* ptest.bbclass: fix error on ubuntu hostChen Qi2013-09-101-9/+15
| | | | | | | | | | | | | | | | | | | | | | | | | 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>
* ptest bug fixesBjörn Stenberg2013-04-111-12/+5
| | | | | | | | | | | | | | | | | | | 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>
* ptest: Move ptest checks from recipes to ptest.bbclassBjörn Stenberg2013-03-071-6/+29
| | | | | | | | | | | 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>
* ptest: Add missed .debug pathBjörn Stenberg2013-02-221-1/+2
| | | | | | | | (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>
* ptest.bbclass: don't add to PACKAGES if disabledChristopher Larson2013-01-181-1/+1
| | | | | | | | | | | | 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>
* Add a new distro feature "ptest".Björn Stenberg2012-12-261-0/+34
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>