Go to file
Martí Bolívar a8612f75c5 scripts: dts: convert test suites to pytest
Use the pytest test framework in the dtlib.py and edtlib.py test
suites (testdtlib.py and testedtlib.py respectively).

The goal here is not to change what is being tested. The existing test
suite is excellent and very thorough.

However, it is made up of executable scripts where all of the tests
are run using a hand-rolled framework in a single function per file.
This is a bit all-or-nothing and prevents various nice features
available in the de-facto standard pytest test framework from being
used.

In particular, pytest can:

- drop into a debugger (pdb) when there is a problem
- accept a pattern which specifies a subset of tests to run
- print very detailed error messages about the actual and expected
  results in various traceback formats from brief to very verbose
- gather coverage data for the python scripts being tested (via plugin)
- run tests in parallel (via plugin)
- It's easy in pytest to run tests with temporary directories
  using the tmp_path and other fixtures. This us avoid
  temporarily dirtying the working tree as is done now.

Moving to pytest lets us leverage all of these things without any loss
in ease of use (in fact, some things are nicer in pytest):

- Any function that starts with "test_" is automatically picked up and
  run. No need for rolling up lists of functions into a test suite.
- Tests are written using ordinary Python 'assert'
  statements.
- Pytest magic unpacks the AST of failed asserts to print details on
  what went wrong in really nice ways. For example, it will show you
  exactly what parts of two strings that are expected to be equal
  differ.

For the most part, this is a pretty mechanical conversion:

- extract helpers and test cases into separate functions
- insert temporary paths and adjust tests accordingly to not match
  file names exactly
- use 'assert CONDITION' instead of 'if not CONDITION: fail()'

There are a few cases where making this happen required slightly
larger changes than that, but they are limited.

Move the checks from check_compliance.py to a new GitHub workflow,
removing hacks that are no longer needed.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-10-02 11:51:15 +02:00
.buildkite ci: double number of builders for daily build 2020-09-22 14:16:58 -05:00
.github scripts: dts: convert test suites to pytest 2020-10-02 11:51:15 +02:00
.known-issues doc: update known issues for Sphinx>=3.2.0 2020-08-31 09:57:33 -04:00
arch arch: arc: Restore MPU registers to its initial states between tests 2020-10-02 11:31:34 +02:00
boards boards: arm: stm32h747i_disco: wakeup pin is active high 2020-10-02 11:48:32 +02:00
cmake ARC: MWDT: drop redundant stack checking 2020-10-02 11:32:12 +02:00
doc Bluetooth: Mesh: Config Client network transmit set/get API 2020-10-02 11:30:12 +02:00
drivers drivers: spi: Set the spi_config before calling Chip select configure 2020-10-02 11:47:23 +02:00
dts dts: bindings: move io-channels and io-channel-names to base.yaml 2020-10-02 11:50:30 +02:00
include Bluetooth: host: Change PA sync callbacks to global callbacks 2020-10-02 11:49:13 +02:00
kernel kernel: timer: update k_timer API for const correctness 2020-10-02 11:29:14 +02:00
lib misc: Replace assert include and calls by sys/__assert.h equivalent 2020-10-02 11:42:40 +02:00
misc
modules modules/Kconfig.nordic: Do not select HAS_CMSIS_CORE through HAS_NRFX 2020-09-23 17:12:01 +02:00
samples drivers: sensors: itds: Remove dts defaults 2020-10-02 11:46:57 +02:00
scripts scripts: dts: convert test suites to pytest 2020-10-02 11:51:15 +02:00
share cmake: Zephyr CMake package clean-up and minor fix 2020-08-19 12:52:33 -04:00
soc drivers: gpio: npcx7: change default pinmux of functional pads to GPIO 2020-10-02 11:44:06 +02:00
subsys Bluetooth: host: Change PA sync callbacks to global callbacks 2020-10-02 11:49:13 +02:00
tests drivers: sensors: itds: Remove dts defaults 2020-10-02 11:46:57 +02:00
.checkpatch.conf checkpatch: disable REPEATED_WORD 2020-08-21 13:57:02 -04:00
.clang-format clang-format: Update with latest FOR_EACH macro list 2020-05-02 11:23:13 -04:00
.codecov.yml
.editorconfig editorconfig: indent Kconfig files with tabs 2020-07-08 21:30:38 -04:00
.gitattributes
.gitignore
.gitlint
.mailmap
.uncrustify.cfg
CMakeLists.txt cmake: export build flags to external build systems excluding SHELL tag 2020-09-10 11:31:53 +02:00
CODE_OF_CONDUCT.md
CODEOWNERS drivers: eth: add driver for w5500 Ethernet Controller 2020-10-02 11:34:57 +02:00
CONTRIBUTING.rst
Kconfig
Kconfig.zephyr cmake: mcuboot: confirmed images needs to be padded 2020-09-04 12:00:04 +02:00
LICENSE
MAINTAINERS.yml mgmt/osdp: Add MAINTAINERS.yml entry for OSDP 2020-09-14 16:00:45 -05:00
Makefile
README.rst doc: Replace shippable badge with buildkite badge 2020-07-14 07:21:44 -05:00
VERSION release: Update patch level to 99 after the 2.4.0 release 2020-09-27 15:15:49 -05:00
version.h.in
west.yml west.yml: Update hal_stm32 to host -pinctr.dtsi 2020-10-01 11:08:42 -05:00
zephyr-env.cmd
zephyr-env.sh

.. raw:: html

   <a href="https://www.zephyrproject.org">
     <p align="center">
       <img src="doc/images/Zephyr-Project.png">
     </p>
   </a>

   <a href="https://bestpractices.coreinfrastructure.org/projects/74"><img
   src="https://bestpractices.coreinfrastructure.org/projects/74/badge"></a>
   <a href="https://buildkite.com/zephyr/zephyr">
   <img
   src="https://badge.buildkite.com/f5bd0dc88306cee17c9b38e78d11bb74a6291e3f40e7d13f31.svg?branch=master"></a>


The Zephyr Project is a scalable real-time operating system (RTOS) supporting
multiple hardware architectures, optimized for resource constrained devices,
and built with security in mind.

The Zephyr OS is based on a small-footprint kernel designed for use on
resource-constrained systems: from simple embedded environmental sensors and
LED wearables to sophisticated smart watches and IoT wireless gateways.

The Zephyr kernel supports multiple architectures, including ARM Cortex-M,
Intel x86, ARC, Nios II, Tensilica Xtensa, and RISC-V, and a large number of
`supported boards`_.

.. below included in doc/introduction/introduction.rst

.. start_include_here

Getting Started
***************

Welcome to Zephyr! See the `Introduction to Zephyr`_ for a high-level overview,
and the documentation's `Getting Started Guide`_ to start developing.

Community Support
*****************

Community support is provided via mailing lists and Slack; see the Resources
below for details.

.. _project-resources:

Resources
*********

Here's a quick summary of resources to help you find your way around:

* **Help**: `Asking for Help Tips`_
* **Documentation**: http://docs.zephyrproject.org (`Getting Started Guide`_)
* **Source Code**: https://github.com/zephyrproject-rtos/zephyr is the main
  repository; https://elixir.bootlin.com/zephyr/latest/source contains a
  searchable index
* **Releases**: https://github.com/zephyrproject-rtos/zephyr/releases
* **Samples and example code**: see `Sample and Demo Code Examples`_
* **Mailing Lists**: users@lists.zephyrproject.org and
  devel@lists.zephyrproject.org are the main user and developer mailing lists,
  respectively. You can join the developer's list and search its archives at
  `Zephyr Development mailing list`_. The other `Zephyr mailing list
  subgroups`_ have their own archives and sign-up pages.
* **Nightly CI Build Status**: https://lists.zephyrproject.org/g/builds
  The builds@lists.zephyrproject.org mailing list archives the CI
  (shippable) nightly build results.
* **Chat**: Zephyr's Slack workspace is https://zephyrproject.slack.com.  Use
  this `Slack Invite`_ to register.
* **Contributing**: see the `Contribution Guide`_
* **Wiki**: `Zephyr GitHub wiki`_
* **Issues**: https://github.com/zephyrproject-rtos/zephyr/issues
* **Security Issues**: Email vulnerabilities@zephyrproject.org to report
  security issues; also see our `Security`_ documentation. Security issues are
  tracked separately at https://zephyrprojectsec.atlassian.net.
* **Zephyr Project Website**: https://zephyrproject.org

.. _Slack Invite: https://tinyurl.com/y5glwylp
.. _supported boards: http://docs.zephyrproject.org/latest/boards/index.html
.. _Zephyr Documentation: http://docs.zephyrproject.org
.. _Introduction to Zephyr: http://docs.zephyrproject.org/latest/introduction/index.html
.. _Getting Started Guide: http://docs.zephyrproject.org/latest/getting_started/index.html
.. _Contribution Guide: http://docs.zephyrproject.org/latest/contribute/index.html
.. _Zephyr GitHub wiki: https://github.com/zephyrproject-rtos/zephyr/wiki
.. _Zephyr Development mailing list: https://lists.zephyrproject.org/g/devel
.. _Zephyr mailing list subgroups: https://lists.zephyrproject.org/g/main/subgroups
.. _Sample and Demo Code Examples: http://docs.zephyrproject.org/latest/samples/index.html
.. _Security: http://docs.zephyrproject.org/latest/security/index.html
.. _Asking for Help Tips: https://docs.zephyrproject.org/latest/guides/getting-help.html