path: root/lib/bb/tests/codeparser.py
Commit message (Collapse)AuthorAgeFilesLines
* data_smart: Allow colon in variable expansion regexRichard Purdie2021-07-301-2/+2
| | | | | | | Now that ":" is a valid character in variable key names, it needs to be allowed by the variable expansion code too, to match. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: Strip old editor directives from file headersRichard Purdie2019-05-041-2/+0
| | | | | | | | There are much better ways to handle this and most editors shouldn't need this in modern times, drop the noise from the files. Its not consitently applied anyway. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: Drop duplicate license boilerplace textRichard Purdie2019-05-041-13/+0
| | | | | | | | With the introduction of SPDX-License-Identifier headers, we don't need a ton of header boilerplate in every file. Simplify the files and rely on the top level for the full licence text. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: Add initial pass of SPDX license headers to source codeRichard Purdie2019-05-041-0/+2
| | | | | | | | | | | | | | | This adds the SPDX-License-Identifier license headers to the majority of our source files to make it clearer exactly which license files are under. The bulk of the files are under GPL v2.0 with one found to be under V2.0 or later, some under MIT and some have dual license. There are some files which are potentially harder to classify where we've imported upstream code and those can be handled specifically in later commits. The COPYING file is replaced with LICENSE.X files which contain the full license texts. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bb.tests.codeparser: add parameter expansion modifiers testChristopher Larson2019-01-181-0/+7
| | | | | | | | | | | We don't want references including shell parameter expansion modifiers (i.e. `:-`, `#`, `%%`, etc) to be added to our vardeps, so add a test to ensure this. YOCTO #12987 Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake-selftest: add contains testsPaul Eggleton2017-04-051-0/+48
| | | | | | | | | Add some tests to verify that we are extracting "contains" information from python expressions in the code in the bb.data and bb.codeparser modules. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/bb/tests/codeparser: update expand syntax in commentJoshua Lock2017-03-211-2/+2
| | | | | | | bb.data.expand(x, d) is deprecated API Signed-off-by: Joshua Lock <joshua.g.lock@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: remove True option to getVar callsJoshua Lock2016-11-301-6/+6
| | | | | | | | | | 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\) Signed-off-by: Joshua Lock <joshua.g.lock@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/bb: Don't use deprecated bb.data.getVar/setVar APIRichard Purdie2016-11-231-7/+7
| | | | | | | | The old style bb.data.getVar/setVar API is obsolete. Most of bitbake doesn't use it but there were some pieces that escaped conversion. This patch fixes the remaining users mostly in the fetchers. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: Convert to python 3Richard Purdie2016-06-011-2/+2
| | | | | | | Various misc changes to convert bitbake to python3 which don't warrant separation into separate commits. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* tests: assertEquals -> assertEqualRichard Purdie2016-05-091-4/+4
| | | | | | | | | The preferred form is assertEqual, assertEquals is deprecated and not present in python v3. This is v2.7 safe. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* tests/codeparser.py: Add filename/lineno flags to test variableOlof Johansson2016-01-191-1/+6
| | | | | | | | | | | | | | | A recent change in bitbake added filename/lineno information to the parameters of bb.data.build_dependencies(). The codeparser tests required a little adaption to the changes, adding the flags to the FOO variable used in the tests. The error seen when running the tests is a TypeError exception raised in bb.codeparser: TypeError: int() argument must be a string or a number, not 'NoneType' Signed-off-by: Olof Johansson <olof.johansson@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* codeparser: Fix var_execs to append to execs, not referencesRichard Purdie2014-03-021-1/+2
| | | | | | | | | When using the "execs" information in new code, it became clear that the returned data was incorrect and there were missing exec'd functions. This corrects the error and changes one of the test results to match the correct behaviour. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* fetch2: Add editor modelines for bb.tests.*Olof Johansson2013-02-171-0/+2
| | | | | Signed-off-by: Olof Johansson <olof.johansson@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* tests/codeparser: Hack around circular inclusion problemRichard Purdie2013-02-151-0/+3
| | | | | | | | There is a circular dependency issue where bb.data can't directly depend on bb.parse. The tests were failing due to this issue which is misleading. This patch hacks around it for now. I'd rather that than not running tests at all. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: Add start of bitbake regression/self testingRichard Purdie2012-05-041-0/+369
This adds some basic unit testing for the codeparser and data store code. Many of the actual test cases were taken from work by Chris Larson's OE-Signatures work but with changes to adapt to the current bitbake APIs we need to test. I also imported CoW tests written by Holger Freyther from the original bitbake-test codebase: http://svn.berlios.de/wsvn/bitbake/trunk/bitbake-tests/tests/ and some tests from the doctests that were removed in commit: http://git.openembedded.org/bitbake/commit?id=3a11c2807972bbbddffde2fa67fc380d159da467 Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>