summaryrefslogtreecommitdiff
path: root/include/test
AgeCommit message (Collapse)Author
2025-05-02test: video: Export the video-checking functionsSimon Glass
We want to check the display contents in expo tests, so move the two needed functions to a new header file. Rename them to have a video_ prefix. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-02-11test: Drop suites.hSimon Glass
This file is empty now. Remove it and its uses. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-02-11test: Make cmd_ut_category() staticSimon Glass
This function is not used outside the cmd_ut file anymore, so make it static. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-02-11test: Drop support for test commandsSimon Glass
Now that everything is using the new test-suite features, drop support for running commands. Fix a missing closing-bracket while we are here. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-02-11test: Drop the function for running optee testsSimon Glass
Use the new suite-runner to run these tests instead. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-02-11test: Update optee to do init and uninit from testsSimon Glass
Rather than having an init function and then running the tests, create a test-init function to do it. This will allow us to get rid of the command function. Fix the comment abotu 'environment' while we are here. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-02-11test: Drop the function for running bootstd testsSimon Glass
Use the new suite-runner to run these tests instead. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-02-11test: Drop the function for running fdt_overlay testsSimon Glass
Use the new suite-runner to run these tests instead. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-02-11test: Update fdt_overlay to do init from testsSimon Glass
Rather than having an init function and then running the tests, create a test-init function to do it. This will allow us to get rid of the command function. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-02-11test: Tweak FDT-overlay testsSimon Glass
Use fdt_overlay consistently in the identifiers and file/dir names. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-02-11test: Support an init/uninit functions for test suitesSimon Glass
Some suites need things to be set up before they can run. Add a way to declare an init function using the UNIT_TEST_INIT() macro. The init function is just like any other test, but is always placed first so that it runs before all the other test functions in the suite. Add an uninit function as well, to clean up after the test. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-02-11test: Show the average time per testSimon Glass
Show the average duration of a test, so we can keep track of how it is trending. Report the suite with the longest average test to encourage people to improve it. Add a function to update the stats based on the results from a single suite and another to show the summary information. Make this optional, since sandbox's SPL tests do not have a timer driver and people may want to print results without times. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-02-11test: Keep track of suite durationSimon Glass
Show the time taken by each test suite with 'ut all' and the total time for all suites. Take care to remove any sandbox time-offset from the values. Fix the comment-format on timer_test_add_offset() while we are here. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-01-24test: Record and show the totals for all test runsSimon Glass
With 'ut all' multiple test suites are run. Add a way to collect totals and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-01-24test: Move stat-printing into its own functionSimon Glass
Add a function to show the stats, so we can decide when to print it. This slightly adjusts the output, so that any 'test not found' message appears on its own line after all other output. The 'failures' message now appears in lower case so update pytest accordingly. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-01-24test: Keep a track of the numbers of tests runSimon Glass
This is useful information and is not always the same as the 'count' arg to ut_run_list() so add it as a separate stat. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-01-24test: Move stats into a structSimon Glass
Use a struct to hold the stats, since we also want to have the same stats for all runs as we have for each suite. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-01-24test: Pass the test state to cmd_ut_category()Simon Glass
Update this function to access a unit-test state, so that the caller can collect results from running multiple suites. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-01-24test: Drop the function for running upl testsSimon Glass
Use the new suite-runner to run these tests instead. It is not clear that these actually work, since they are not enabled on sandbox for some reason. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-01-24test: Drop the function for running seama testsSimon Glass
Use the new suite-runner to run these tests instead. It is not clear that these actually work, since they are not enabled on sandbox for some reason. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Linus Walleij <linus.walleij@linaro.org>
2025-01-24test: Drop the function for running pci_mps testsSimon Glass
Use the new suite-runner to run these tests instead. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-01-24test: Drop the function for running loadm testsSimon Glass
Use the new suite-runner to run these tests instead. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-01-24test: Drop the function for running hush testsSimon Glass
Use the new suite-runner to run these tests instead. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-01-24test: Drop the function for running addrmap testsSimon Glass
Use the new suite-runner to run these tests instead. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-01-24test: Drop the function for running bootm testsSimon Glass
Use the new suite-runner to run these tests instead. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-01-24test: Drop the function for running bloblist testsSimon Glass
Use the new suite-runner to run these tests instead. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-01-24test: Drop the function for running measurement testsSimon Glass
Use the new suite-runner to run these tests instead. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-01-24test: Drop the function for running setexpr testsSimon Glass
Use the new suite-runner to run these tests instead. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-01-24test: Drop the function for running mem testsSimon Glass
Use the new suite-runner to run these tests instead. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-01-24test: Drop the function for running mbr testsSimon Glass
Use the new suite-runner to run these tests instead. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-01-24test: Drop the function for running log testsSimon Glass
Use the new suite-runner to run these tests instead. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-01-24test: Drop the function for running lib testsSimon Glass
Use the new suite-runner to run these tests instead. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-01-24test: Drop the function for running font testsSimon Glass
Use the new suite-runner to run these tests instead. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-01-24test: Drop the function for running fdt testsSimon Glass
Use the new suite-runner to run these tests instead. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-01-24test: Drop the function for running exit testsSimon Glass
Use the new suite-runner to run these tests instead. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-01-24test: Drop the function for running env testsSimon Glass
Use the new suite-runner to run these tests instead. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-01-24test: Drop the function for running dm testsSimon Glass
Use the new suite-runner to run these tests instead. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-01-24test: Drop the function for running common testsSimon Glass
Use the new suite-runner to run these tests instead. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-01-24test: Drop the function for running cmd testsSimon Glass
Use the new suite-runner to run these tests instead. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-01-24test: Drop the function for running bdinfo testsSimon Glass
Use the new suite-runner to run these tests instead. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-01-24test: Introduce a better array of test suitesSimon Glass
The current cmd_ut_sub[] array was fine when there were only a few test suites. But is quite unwieldy now: - it requires a separate do_ut_xxx for each suite, even though the code for most is almost identical - running more than one suite requires running multiple commands, and there is no record of which suites passed or failed - 'ut all' runs all suites but reports their results individually - we need lots of #ifdefs in the array, mirroring those in the makefile but maintained in a separate place In fact the tests are all in the same linker list. The suites are grouped, so it is possible to access the information without a command. Introduce a 'suite' array, which holds the cmd_ut_...() function to call, but can also support running a suite without that function. This means that the array of struct cmd_tbl is transformed into an array of 'struct suite'. This will allow removal of many of the functions, particularly those without test-specific init. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-01-24test: Drop the _test suffix on linker listsSimon Glass
Most test suites have a _test suffix. This is not necessary as there is also a ut_ prefix. Drop the suffix so that (with future work) the suite name can be used as the linker-list name. Remove the suffix from the pytest regex as well, moving it to the top of the file, as it is a constant. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-01-24test: Rename test suites to match their linker-list nameSimon Glass
Some suites have a different name from that used in the linker list. That makes it hard to programmatically match the name printed when the suite runs to the linker-list name it has. Update the names so they are the same. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-01-24test: Pass the test-state into ut_run_list()Simon Glass
Pass this into the function so that callers can inspect the state afterwards. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-01-24test: Rename test_get_state() to ut_get_state()Simon Glass
Rename this function and test_set_state() so use the same ut_ prefix as other functions in ut.h Signed-off-by: Simon Glass <sjg@chromium.org>
2025-01-24test: Drop unused suite prototypesSimon Glass
Drop some the prototypes for functions which were removed in earlier series. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-11-13Merge patch series "test: Tidy up the test/ directory"Tom Rini
Simon Glass <sjg@chromium.org> says: Some tests do not use the unit-test framework. Others are in a suite of their own, for no obvious reason. This series tidies this up. Link: https://lore.kernel.org/r/20241102193715.432529-1-sjg@chromium.org
2024-11-13compression: test: Move into the lib suiteSimon Glass
There is no particular need for compression to have its own test suite. Move it into the lib suite instead. Add the missing help for 'common' and update the docs. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Tom Rini <trini@konsulko.com> # rpi_3, rpi_4, rpi_arm64, am64x_evm_a53, am64-sk
2024-11-03test: Allow saving and restoring the bloblistSimon Glass
Tests which create a new bloblist overwrite the existing one in sandbox. Provide a flag for tests to declare this behaviour. Save and restore the bloblist pointer so that other tests remain unaffected. Note that when sandbox is running normally, the bloblist has been relocated to high in memory. The existing bloblist tests create a new bloblist low in memory, so they do not conflict. Correct a build error on coreboot by using accessors for gd->bloblist: Signed-off-by: Simon Glass <sjg@chromium.org>
2024-10-18expo: Use standard numbering for save and discardSimon Glass
Set aside some expo IDs for 'save' and 'discard' buttons. This avoids needing to store the IDs for these. Adjust the documentation and expo tool for the new EXPOID_BASE_ID value. Ignore these objects when saving and loading the cedit, since they do not contain real data. Adjust 'cedit run' to return failure when the user exits the expo without saving. Update the test for this change as well. Signed-off-by: Simon Glass <sjg@chromium.org>