When detecting changes to boards, make sure we test all board
configurations available in that board directory, not only the main one.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Add a simple Coccinelle script that counts identifier lengths and
prints out a warning if it is longer than 31 characters.
The script can be run with:
spatch -D report --very-quiet \
--include-headers --recursive-includes \
--cocci-file $ZEPHYR_BASE/scripts/coccinelle/identifier_length.cocci \
--dir $ZEPHYR_BASE \
kernel/
Where '--include-headers' and '--recursive-includes' can be omitted
if neede.
Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
The Harness handlers for tests were parsing the realtime stream out of
qemu pipes by recompiling and executing every regex for every line (!)
of output from the simulator. That's a significant CPU load, and it's
(1) in a separate thread not tracked by the JOBS limit and (2)
happening at the worst possible time and contending with the qemu
process for host CPU cycles that it needs to hit its (real world)
timer targets on time.
Compile them just once, please.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
Splitting a string like 'foo="bar=baz"' on '=' will give ['foo', '"bar',
'baz"'] instead of the intended ['foo', '"bar=baz"']. split() with
maxsplit=1 to avoid potential issues.
Not seen in practice. Just some future safety.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Update Kconfiglib and menuconfig to upstream revision 90c5573c19, to get
these commits in:
Warn for unquoted argument to 'source', etc.
Print a warning suggesting to add quotes for things like
source foo/bar/Kconfig
menu title
prompt unquoted
Example warning:
Kconfig:32: warning: style: quotes recommended around
'lib/Kconfig.debug' in 'source lib/Kconfig.debug'
That quoteless syntax is supported for compatibility with old
versions of the C tools. It only works for a single word.
==================================================================
menuconfig: Include all parents in menu paths
Previously, symbols not defined with 'menuconfig' with children
weren't listed in the children's menu paths. It was deliberate, but
it's probably an anti-feature in retrospect, because it can make it
harder to find stuff by following the menu path.
Don't try to be clever and just list all the parent nodes in the
menu path.
==================================================================
menuconfig: Fix display issue for optional-prompt menuconfigs
_shown_nodes() needs to check whether invisible 'menuconfig' symbols
with optional prompts have visible children, so that they can be
shown outside show-all mode. Previously, only 'config' symbols were
checked.
==================================================================
menuconfig: Remember last saved/loaded path and improve
_conf_changed
Remember the last path that was manually saved/loaded instead of
reverting back to standard_config_filename() (e.g. .config).
Remember the path to the last saved minimal configuration separately
as well.
Also improve the _conf_changed behavior when loading a .config
within the interface. Instead of always treating it as needing to be
saved, check if it's outdated, like for the .config file loaded on
startup.
Also make the exit message ("No changes to save", etc.) always
include the target .config file, which is helpful. Previously, only
the save message did.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Add a new command-line and build config option, `pristine`, that the
user can pass to `west build` or set in its configuration file(s) in
order to automatically trigger a pristine build on every build or
whenever west considers it required.
The option can take the following values:
- never: Never run the target
- always: Always run the pristine target before building
- auto: Run the pristine target when required
With `auto`, the pristine target will be run when running
west with an existing build folder containing a build system and:
- Selecting a different board from the one currently in the build system
- Selecting a different application from the one currently in the build
system
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
The -B option has always existed but was first officially documented in
CMake 3.13.0. In that same release the -S option was introduced,
replacing the old undocumented -H. Switch to using the officially
documented options.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
One of the first things needed when comparing builds of tests across
different environments/systems is to make sure the same (sub)tests were
selected and run in the first place. For that purpose sort the output of
--testcase-report and --discard-report as they were in random order.
Actually make the entire class TestInstance sortable by adding a
standard __lt__() method comparing unique instance names; it could be
useful again.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
This makes the output of file2hex.py deterministic by default while also
letting the user set the mtime in the gzip header manually if desired.
Use the option without any argument to restore the previous behavior
that sets the current (and obviously changing) "now" timestamp.
To test: ./sanitycheck --tag gen_inc_file
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
This is an old script for finding references to undefined Kconfig
symbols that assumes Kconfiglib 1 (an older API).
There's now a different check for references to undefined symbols (see
commit 1d0834b35f ("checks: kconfig: Check for references to undefined
Kconfig symbols") in the ci-tools repo).
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
This includes a bugfix for a pyocd requirement on pyyaml
that could not be satisfied using officially supported
releases.
Signed-off-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
After the testcase configs are built, there is a step to
filter all the test case information to determine the set
of tests to run.
As this step takes a nontrivial amount of time, add an
informational message about it.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Fixes: #15289
Kconfig requires posix style path when sourcing other files.
As abspath in python will use native host style, i.e. backslash '\' in
windows this will cause invalid paths in Kconfig generated file and
thus the file will never be loaded.
This commit uses PurePath to convert the path to posix style, ensuring
Kconfig can load the modules.
Signed-off-by: Torsten Rasmussen <torsten.rasmussen@nordicsemi.no>
Update the files which contain no license information with the
'Apache-2.0' SPDX license identifier. Many source files in the tree are
missing licensing information, which makes it harder for compliance
tools to determine the correct license.
By default all files without license information are under the default
license of Zephyr, which is Apache version 2.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Rename reserved function names in arch/ subdirectory. The Python
script gen_priv_stacks.py was updated to follow the 'z_' prefix
naming.
Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
For systems without userspace enabled, these work the same
as a k_mutex.
For systems with userspace, the sys_mutex may exist in user
memory. It is still tracked as a kernel object, but has an
underlying k_mutex that is looked up in the kernel object
table.
Future enhancements will optimize sys_mutex to not require
syscalls for uncontended sys_mutexes, using atomic ops
instead.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
The data value in a kernel object structure is specific
to that type of object. Allow this to be a reference to
another C symbol or other compiled code by populating as
a string.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Some forthcoming kernel object types like futexes need to
be tracked, but do not contain data that is private to
the kernel.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
The code coverage reports on pull requests has been inconsistent and
confusing. Disable them for pull-requests.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Some logging text and colors were not escaped correctly, make sure we
generate well formed XML reports.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
We have not been counting samples in reports. This change lists tests
associated with sample code which in many cases is just verifying output
from the sample and counts as 1 test.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Due to the fact that CMake only supports greedy regexes,
the ':' in a Windows path ('C:\...') was being matched leading
to an invalid split of the line. Quote both the name and the path
to avoid this issue.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Fixes: #14513
This commit move the functionality of extracting zephyr modules into
generated CMake and Kconfig include files from CMake into python.
This allows other tools, especially CI to re-use the zephyr module
functionality.
Signed-off-by: Torsten Rasmussen <torsten.rasmussen@nordicsemi.no>
Zero functional change, this is pure refactoring and preparation for
using the mtime= parameter which the gzip.compress() shortcut does not
make available.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Update the script to detect and update more instances of unsigned
variable assignments when using all four simple rules of arithmetics.
Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
Fixes pylint warnings like this one:
doc/conf.py:325:0: W1401: Anomalous backslash in string: '\s'.
String constant might be missing an r prefix.
(anomalous-backslash-in-string)
The reason for this warning is that backslash escapes are interpreted in
non-raw (non-r-prefixed) strings. For example, '\a' and r'\a' are not
the same string (first one has a single ASCII bell character, second one
has two characters).
It just happens that there's no \s (or \., or \/) escape for example,
and '\s' turns into two characters (as needed for a regex). It's risky
to rely on stuff like that regexes though. Best to make them raw strings
unless they're super trivial.
Also note that '\s' and '\\s' turn into the same string.
Another tip: A literal ' can be put into a string with "blah'blah"
instead of 'blah\'blah'.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
The /memreserve/ code would crash if it ever ran, because 'name' isn't
defined (seems to be some copy-paste here). There are no /memreserve/s
in Zephyr though, so it works out.
'name' seems to be the node name. Not sure what to put for a
/memreserve/, but make it '<memreserve>' to make it stand out.
Fixes a pylint warning.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
self.num_members doesn't exist. This commit just removes the reference,
because I didn't want to guess a proper fix.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Using a member variable in the dict comprehension was probably a typo
(can't see 'sym' referenced elsewhere). Use a local variable instead.
Made pylint spit out these warnings (which might be spurious though):
scripts/elf_helper.py:535:24: E0203: Access to member 'sym' before
its definition line 536 (access-member-before-definition)
scripts/elf_helper.py:535:39: E0203: Access to member 'sym' before
its definition line 536 (access-member-before-definition)
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Discovered with pylint3.
Use the placeholder name '_' for unproblematic unused variables. It's
what I'm used to, and pylint knows not to flag it.
Python tip:
for i in range(n):
some_list.append(0)
can be replaced with
some_list += n*[0]
Similarly, 3*'\t' gives '\t\t\t'.
(Relevant here because pylint flagged the loop index as unused.)
To do integer division in Python 3, use // instead of /.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Discovered with pylint3.
Use the placeholder name '_' for unproblematic unused variables. It's
what I'm used to, and pylint knows not to flag it.
Also improve the naming a bit in devicetree.py. If a key/value is known
to be a specific thing (like a node), then it's helpful to call it that
instead of something generic like "value".
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Fix --help message. Also rename run_report() to save_tests() as it's
used only once by --save-tests and nowhere else. Maybe the code was
shared with some --other-report feature in the past but not any more.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
debug_die() is not implemented in this class, and indeed we
don't even have a reference to the DWARF DIE object.
This is a fatal error anyway, just raise an exception.
Fixes#14762
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Also add a "generated by sanitycheck" header to indicate origin and a
warning about the dependency required to actually run the test.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
os.exit() doesn't exist.
Also use the nifty sys.exit(msg) feature, which prints 'msg' to stderr
and exits with status 1.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Not needed in Python. Detected by check C0325 in pylint3.
Also replace an
if len(tag):
with just
if tag:
Empty strings, byte strings, lists, etc., are falsy in Python.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Making a clean slate for some pylint CI tests. Only enabling relatively
uncontroversial stuff.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Needs to be at the beginning of the file. Fixes a pylint warning:
scripts/process_gperf.py:26:-1: W0105: String statement has no
effect (pointless-string-statement)
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Needs to be at the beginning of the file. Fixes a pylint warning:
scripts/process_gperf.py:26:-1: W0105: String statement has no
effect (pointless-string-statement)
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
- Fix wrong --test help message
- Provide more examples to clarify naming hierarchy
- Document that --sub-test runs its entire --test
- Point out that save/load options use their own format
- Document that --list-tests is flattened
Signed-off-by: Marc Herbert <marc.herbert@intel.com>