summaryrefslogtreecommitdiffstats
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* test: self: add tests for progress notifierAhmad Fatoum2021-06-285-0/+86
| | | | | | | | | We don't yet have any boards upstream that make use of the progress notifier, but at least have some tests, so we know it's working. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Link: https://lore.barebox.org/20210619054048.498826-1-ahmad@a3f.at Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* test: add bthread testAhmad Fatoum2021-06-092-0/+25
| | | | | | | | | | | | The bthread -v command already returns an appropriate exit code if threads can't be scheduled. Have it spawn 16 threads and switch between them for a second and verify that all of these threads were indeed terminated. Acked-by: Rouven Czerwinski <r.czerwinski@pengutronix.de> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210604084704.17410-14-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* test: self: run selftests as part of the pytest suiteAhmad Fatoum2021-06-092-0/+12
| | | | | | | | | | | | | | | | | We don't want to enable self tests in the normal configs as they may, in future, bloat size needlessly. Enable it instead in the base.cfg fragment and add a test that verifies the selftest command runs without errors. Selftests can be run on startup for CONFIG_SHELL_NONE systems. This is not implemented here. For such systems the test will be skipped as CONFIG_CMD_SELFTEST won't be defined. To manually skip with emulate.pl, add --no-kconfig-base. Acked-by: Rouven Czerwinski <r.czerwinski@pengutronix.de> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210604084704.17410-13-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* test: add emulate.pl, a runner for barebox on emulated targetsAhmad Fatoum2021-06-093-0/+528
| | | | | | | | | | | | | | | | | | | This script is a wrapper around tuxmake, qemu and labgrid-pytest. It parses the same YAML files, labgrid-pytest uses and instructs tuxmake to build and collect the needed images. By default, it will start an interactive emulator session, but with --test, it can also run labgrid-pytest instead. The script has some knowledge of QEMU options to make common tasks like passing images straight-forward. Script is written with both manual use and CI in mind. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210604084704.17410-12-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* test: add first sample testsAhmad Fatoum2021-06-097-0/+155
| | | | | | | | | | | The test can be run manually with e.g. labgrid-pytest --lg-env test/arm/qemu_virt64_defconfig.yaml test/py Acked-by: Rouven Czerwinski <r.czerwinski@pengutronix.de> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210604084704.17410-11-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* test: add labgrid-style configs for some emulated targetsAhmad Fatoum2021-06-0922-0/+393
| | | | | | | | | | | | | | | | | | | | | There are various ways barebox can run under emulation, some of them are described in the documentation and some more in the git history. Make running the emulators more convenient to use by collecting some known-good emulator invocations in a machine readable format. These files can be processed by a test/emulate.pl script added in a follow-up commit. They contain enough information to configure, build and run barebox inside an emulator. Those YAML files utilizing QEMUDriver can also be directly parsed by labgrid for running tests. Utilizing labgrid for this will allow using the same test suite for physical targets as well in future. Acked-by: Rouven Czerwinski <r.czerwinski@pengutronix.de> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210604084704.17410-10-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* test: self: port Linux printf kselftestAhmad Fatoum2021-06-093-0/+309
| | | | | | | | | | | Port over the Linux v5.11 selftest for printf sans the parts we don't support. This can be used to catch regressions if changes affecting the printf code are made. Acked-by: Rouven Czerwinski <r.czerwinski@pengutronix.de> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210604084704.17410-9-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* test: add basic barebox self-test infrastructureAhmad Fatoum2021-06-095-0/+67
Self tests is code written to run within barebox to exercise functionality. They offer flexibility to test specific units of barebox instead of the program as a whole. Add a very simple infrastructure for registering and executing self-tests. This is based on the Linux kselftest modules. We don't utilize modules for this, however, because we only have module support on ARM, but we need a generic solution. Selftests can be enabled individually and even tested without shell support to allow tests to happen for size-restricted barebox images as well. Acked-by: Rouven Czerwinski <r.czerwinski@pengutronix.de> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210604084704.17410-8-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>