aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bb/tests/codeparser.py
AgeCommit message (Collapse)Author
2021-07-30data_smart: Allow colon in variable expansion regexRichard Purdie
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>
2019-05-04bitbake: Strip old editor directives from file headersRichard Purdie
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>
2019-05-04bitbake: Drop duplicate license boilerplace textRichard Purdie
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>
2019-05-04bitbake: Add initial pass of SPDX license headers to source codeRichard Purdie
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>
2019-01-18bb.tests.codeparser: add parameter expansion modifiers testChristopher Larson
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>
2017-04-05bitbake-selftest: add contains testsPaul Eggleton
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>
2017-03-21lib/bb/tests/codeparser: update expand syntax in commentJoshua Lock
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>
2016-11-30bitbake: remove True option to getVar callsJoshua Lock
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>
2016-11-23lib/bb: Don't use deprecated bb.data.getVar/setVar APIRichard Purdie
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>
2016-06-01bitbake: Convert to python 3Richard Purdie
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>
2016-05-09tests: assertEquals -> assertEqualRichard Purdie
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>
2016-01-19tests/codeparser.py: Add filename/lineno flags to test variableOlof Johansson
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>
2014-03-02codeparser: Fix var_execs to append to execs, not referencesRichard Purdie
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>
2013-02-17fetch2: Add editor modelines for bb.tests.*Olof Johansson
Signed-off-by: Olof Johansson <olof.johansson@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-15tests/codeparser: Hack around circular inclusion problemRichard Purdie
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>
2012-05-04bitbake: Add start of bitbake regression/self testingRichard Purdie
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>