summaryrefslogtreecommitdiffstats
path: root/include/test
Commit message (Collapse)AuthorAgeFilesLines
* test: provide unit test for memory functionsHeinrich Schuchardt2019-02-092-0/+15
| | | | | | | | | | | | Memory functions may have architecture specific implementations. These should be tested. Provide unit tests for memset(), memcpy(), memmove(). Provide a 'ut lib' sub-command to execute the tests. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
* test: Add a simple test for bloblistSimon Glass2018-11-261-0/+1
| | | | | | | Add a unit test for the bloblist functionality and enable bloblist for sandbox. Signed-off-by: Simon Glass <sjg@chromium.org>
* test: Add ut_asserteq_memMario Six2018-09-281-0/+18
| | | | | | | | Add a unit test assert-method, which compares two given memory areas for byte-wise equality. Signed-off-by: Mario Six <mario.six@gdsys.cc> Reviewed-by: Simon Glass <sjg@chromium.org>
* test: unit tests for Unicode functionsHeinrich Schuchardt2018-09-231-1/+2
| | | | | | | Provide unit tests for Unicode functions. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
* test: fix typo in cmd_ut_category() descriptionHeinrich Schuchardt2018-08-311-1/+1
| | | | | | | | | | argc = 1: all tests are run argc > 1: only argv[1] is run So we need argc >= 1. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
* test: Add ut_assertnull macroRamon Fried2018-07-191-0/+12
| | | | | | | | Add ut_assertnull macro to include/test/ut.h For testing of functions that returns NULL on errors. Signed-off-by: Ramon Fried <ramon.fried@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* SPDX: Convert all of our single license tags to Linux Kernel styleTom Rini2018-05-076-12/+6
| | | | | | | | | | | | | | | | | | | | When U-Boot started using SPDX tags we were among the early adopters and there weren't a lot of other examples to borrow from. So we picked the area of the file that usually had a full license text and replaced it with an appropriate SPDX-License-Identifier: entry. Since then, the Linux Kernel has adopted SPDX tags and they place it as the very first line in a file (except where shebangs are used, then it's second line) and with slightly different comment styles than us. In part due to community overlap, in part due to better tag visibility and in part for other minor reasons, switch over to that style. This commit changes all instances where we have a single declared license in the tag as both the before and after are identical in tag contents. There's also a few places where I found we did not have a tag and have introduced one. Signed-off-by: Tom Rini <trini@konsulko.com>
* test: compression: Convert to unit test frameworkSimon Glass2017-12-042-0/+18
| | | | | | | | | | | Adjust this test to use the unit test framework. Drop the two existing commands for running the tests and replace them with a single 'ut compression' command, with sub-commands. Signed-off-by: Simon Glass <sjg@chromium.org> [trini: Continue to have ret = run_test_internal(...) in run_test so ret is always initialized] Signed-off-by: Tom Rini <trini@konsulko.com>
* test: Add a command function for test executionSimon Glass2017-12-021-0/+16
| | | | | | | | The logic to either iterate through a list of tests or pick a named test is common to at lest two test suits. Move this logic into a new function and call it from the environment tests. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: test: Fix nit with position of backslashSimon Glass2017-06-011-1/+1
| | | | | | Line up this backslash with all the others. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: core: Run tests with both livetree and flat treeSimon Glass2017-06-011-0/+2
| | | | | | | | | | | Some tests require either livetree or flat tree. Add flags to allow the tests to specify this. Adjust the test runner to run with livetree (if supported) and then flat tree. Some video tests are quite slow and running on flat tree adds little extra test value, so run these on livetree only. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: test: Show the test filename when runningSimon Glass2017-06-011-0/+2
| | | | | | | Show the filename of the test being run. Skip the path and show just the base name. Signed-off-by: Simon Glass <sjg@chromium.org>
* tests: Introduce DT overlay testsMaxime Ripard2016-08-202-0/+17
| | | | | | | | | | | | This adds a bunch of unit tests for the "fdt apply" command. They've all been run successfully in the sandbox. However, as you still require an out-of-tree dtc with overlay support, this is disabled by default. Acked-by: Simon Glass <sjg@chromium.org> Acked-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
* Fix spelling of "occurred".Vagrant Cascadian2016-05-021-6/+6
| | | | | Signed-off-by: Vagrant Cascadian <vagrant@debian.org> Reviewed-by: Simon Glass <sjg@chromium.org>
* test: Add a macro to check that a value is not an error pointerSimon Glass2015-07-211-0/+15
| | | | | | | Some functions can return ERR_PTR(errval). Add a unit test macro to check that no error is returned in a pointer. Signed-off-by: Simon Glass <sjg@chromium.org>
* test: env: Add test framework for envJoe Hershberger2015-05-212-0/+17
| | | | | | | | | | Add a new "env" subcommand to the ut command. This will run unit tests on the env code. This should be targetable to any device that supports the env features needed for the tests. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* test: Return values from the asserts compatible with cmdsJoe Hershberger2015-05-211-6/+6
| | | | | | | | | | The asserts are sometimes called from the context of the test command itself so make sure that a return that happens as a result of a failure is compatible with that command return. When called within a test, the return value is ignored. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* test: dm: Move the time test over to the ut commandJoe Hershberger2015-05-211-0/+1
| | | | | | | Unify the command for running unit tests further by moving the "ut_time" command over to "ut time". Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
* test: dm: Move the dm tests over to the ut commandJoe Hershberger2015-05-211-0/+2
| | | | | | | | Unify the command for running unit tests further by moving the "dm test" command over to "ut dm". Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Acked-by: Simon Glass <sjg@chromium.org>
* test: Add a common unit test commandJoe Hershberger2015-05-211-0/+11
| | | | | | | | Add a command that all other unit tests should be a sub-command of. Also include a command that will run all tests. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Acked-by: Simon Glass <sjg@chromium.org>
* test: Generalize the unit test frameworkJoe Hershberger2015-05-212-0/+154
Separate the ability to define tests and assert status of test functions from the dm tests so they can be used more consistently throughout all tests. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Reviewed-by: Simon Glass <sjg@chromium.org>