<feed xmlns='http://www.w3.org/2005/Atom'>
<title>u-boot.git/test/test-main.c, branch v2023.07.01</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<id>http://cgit.235523.xyz/u-boot.git/atom/test/test-main.c?h=v2023.07.01</id>
<link rel='self' href='http://cgit.235523.xyz/u-boot.git/atom/test/test-main.c?h=v2023.07.01'/>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/'/>
<updated>2023-06-21T00:56:27Z</updated>
<entry>
<title>test: dm: restore /firmware nodes after testing</title>
<updated>2023-06-21T00:56:27Z</updated>
<author>
<name>AKASHI Takahiro</name>
<email>takahiro.akashi@linaro.org</email>
</author>
<published>2023-06-08T00:55:59Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=230038f8ef0e2e7db8e40957a3b35109d8f7459f'/>
<id>urn:sha1:230038f8ef0e2e7db8e40957a3b35109d8f7459f</id>
<content type='text'>
dm_test_restore() is called after dm unit test is run.
But this function does not scan any nodes under /firmware since
it calls dm_scan_fdt().

This causes an issue. For instance, scmi_sandbox_agent device
will disappear after running 'ut dm scmi_sandbox_agent'.

So call dm_extended_scan() instead. This change will be coherent
with what dm_scan() and test_pre_run() does.

Signed-off-by: AKASHI Takahiro &lt;takahiro.akashi@linaro.org&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
</entry>
<entry>
<title>test: Tidy up sandbox handling in test-main</title>
<updated>2023-03-02T22:45:58Z</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2023-02-22T16:34:12Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=d5774594974307b5eae0b49928920046db02a5cc'/>
<id>urn:sha1:d5774594974307b5eae0b49928920046db02a5cc</id>
<content type='text'>
This is pretty messy at present since it relies on a SPL_SANDBOX option
that does not exist. Use the normal options instead, so that it will work
with split config.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
</entry>
<entry>
<title>sandbox: Allow SPI flash bootdevs to be disabled for tests</title>
<updated>2023-01-23T23:11:41Z</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2023-01-17T17:48:02Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=081bdc52c158dd3a4f73910cde3d7e70a5932d56'/>
<id>urn:sha1:081bdc52c158dd3a4f73910cde3d7e70a5932d56</id>
<content type='text'>
Most tests don't want these and they can create a lot of noise. Add a way
to disable them. Use that in tests, with a flag provided to enable them
for tests that need this feature.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
</entry>
<entry>
<title>sandbox: Allow ethernet bootdevs to be disabled for tests</title>
<updated>2023-01-23T23:11:39Z</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2023-01-17T17:47:28Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=70dd88657b45e5439bf762507f2e1c44c2dee289'/>
<id>urn:sha1:70dd88657b45e5439bf762507f2e1c44c2dee289</id>
<content type='text'>
Most tests don't want these and can create a lot of noise. Add a way to
disable them. Use that in tests, with a flag provided to enable them for
tests that need this feature.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
</entry>
<entry>
<title>dm: test: Correct ordering of DM setup</title>
<updated>2023-01-23T23:11:39Z</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2023-01-17T17:47:23Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=ecb274cf06b79c791509e43af53d5a2ff1112941'/>
<id>urn:sha1:ecb274cf06b79c791509e43af53d5a2ff1112941</id>
<content type='text'>
We must call dm_scan_other() after devices from the device tree have been
created, since that function behaves differently if there is no bootstd
device.

Adjust the logic to achieve this.

Also fix the bootflow_system() test which was relying on this broken
behaviour.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
</entry>
<entry>
<title>test: Drop duplicate restore of DM state</title>
<updated>2023-01-23T23:11:39Z</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2023-01-17T17:47:18Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=3f23ce2b6c58a489b3377e1fc1449ca293892546'/>
<id>urn:sha1:3f23ce2b6c58a489b3377e1fc1449ca293892546</id>
<content type='text'>
This code is present twice. Fix it so that it is only executed once.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
</entry>
<entry>
<title>test: Add a way to detect a test that breaks another</title>
<updated>2022-11-07T23:24:30Z</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2022-10-30T01:47:13Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=d1b46595700b063faaec3e33f5754642e68b3d8f'/>
<id>urn:sha1:d1b46595700b063faaec3e33f5754642e68b3d8f</id>
<content type='text'>
When running unit tests, some may have side effects which cause a
subsequent test to break. This can sometimes be seen when using 'ut dm'
or similar.

Add a new argument which allows a particular (failing) test to be run
immediately after a certain number of tests have run. This allows the
test causing the failure to be determined.

Update the documentation also.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
</entry>
<entry>
<title>test: Drop an unused parameter to ut_run_test_live_flat()</title>
<updated>2022-11-07T23:24:30Z</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2022-10-30T01:47:09Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=f7a68d228416deeb279457af8d548603abfad004'/>
<id>urn:sha1:f7a68d228416deeb279457af8d548603abfad004</id>
<content type='text'>
The select_name parameter is not used anymore. Drop it.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
</entry>
<entry>
<title>dm: test: Clear the block cache after running a test</title>
<updated>2022-11-07T23:24:30Z</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2022-10-30T01:47:08Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=5ea894ac4285be2bebc2e7bdfd6451c699469f37'/>
<id>urn:sha1:5ea894ac4285be2bebc2e7bdfd6451c699469f37</id>
<content type='text'>
Some tests access data in block devices and so cause the cache to fill
up. This results in memory being allocated.

Some tests check the malloc usage at the beginning and then again at the
end, to ensure there is no memory leak caused by the test. The block cache
makes this difficult, since the any test may cause entries to be allocated
or even freed, if the cache becomes full.

It is simpler to clear the block cache after each test. This ensures that
it will not introduce noise in tests which check malloc usage.

Add the logic to clear the cache, using the existing blkcache_invalidate()
function. Drop the duplicate code at the same time.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
</entry>
<entry>
<title>cyclic: get rid of cyclic_init()</title>
<updated>2022-11-02T07:42:03Z</updated>
<author>
<name>Rasmus Villemoes</name>
<email>rasmus.villemoes@prevas.dk</email>
</author>
<published>2022-10-28T11:50:54Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=50128aeb0f8bb5a2d820e4c7a6ac0bb745809fc1'/>
<id>urn:sha1:50128aeb0f8bb5a2d820e4c7a6ac0bb745809fc1</id>
<content type='text'>
Currently, we must call cyclic_init() at some point before
cyclic_register() becomes possible. That turns out to be somewhat
awkward, especially with SPL, and has resulted in a watchdog callback
not being registered, thus causing the board to prematurely reset.

We already rely on gd-&gt;cyclic reliably being set to NULL by the asm
code that clears all of gd. Now that the cyclic list is a hlist, and
thus an empty list is represented by a NULL head pointer, and struct
cyclic_drv has no other members, we can just as well drop a level of
indirection and put the hlist_head directly in struct
global_data. This doesn't increase the size of struct global_data,
gets rid of an early malloc(), and generates slightly smaller code.

But primarily, this avoids having to call cyclic_init() early; the cyclic
infrastructure is simply ready to register callbacks as soon as we
enter C code.

We can still end up with schedule() being called from asm very early,
so we still need to check that gd itself has been properly initialized
[*], but once it has, gd-&gt;cyclic_list is perfectly fine to access, and
will just be an empty list.

As for cyclic_uninit(), it was never really the opposite of
cyclic_init() since it didn't free the struct cyclic_drv nor set
gd-&gt;cyclic to NULL. Rename it to cyclic_unregister_all() and use that
in test/, and also insert a call at the end of the board_init_f
sequence so that gd-&gt;cyclic_list is a fresh empty list before we enter
board_init_r().

A small piece of ugliness is that I had to add a cast in
cyclic_get_list() to silence a "discards 'volatile' qualifier"
warning, but that is completely equivalent to the existing handling of
the uclass_root_s list_head member.

[*] I'm not really sure where we guarantee that the register used for
gd contains 0 until it gets explicitly initialized, but that must be
the case, otherwise testing gd for being NULL would not make much sense.

Signed-off-by: Rasmus Villemoes &lt;rasmus.villemoes@prevas.dk&gt;
Reviewed-by: Stefan Roese &lt;sr@denx.de&gt;
Tested-by: Stefan Roese &lt;sr@denx.de&gt;
Tested-by: Tim Harvey &lt;tharvey@gateworks.com&gt; # imx8mm-venice-*
</content>
</entry>
</feed>
