<feed xmlns='http://www.w3.org/2005/Atom'>
<title>u-boot.git/test/py/conftest.py, branch master</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/'/>
<entry>
<title>test/py: Fix spelling of source_dir in docstring</title>
<updated>2026-02-16T17:52:01+00:00</updated>
<author>
<name>David Lechner</name>
<email>dlechner@baylibre.com</email>
</author>
<published>2026-02-06T21:31:14+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=6f96026b1e33207762ca0a936abd3b132a8fc0ee'/>
<id>6f96026b1e33207762ca0a936abd3b132a8fc0ee</id>
<content type='text'>
Fix a typo in the docstring for run_build() where source_dir was
misspelled.

Signed-off-by: David Lechner &lt;dlechner@baylibre.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix a typo in the docstring for run_build() where source_dir was
misspelled.

Signed-off-by: David Lechner &lt;dlechner@baylibre.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>test.py: check ubconfig exists before using it</title>
<updated>2026-01-12T21:12:41+00:00</updated>
<author>
<name>David Lechner</name>
<email>dlechner@baylibre.com</email>
</author>
<published>2026-01-05T16:49:13+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=637942ac8e093163742d7b74bf80836c3b950c4e'/>
<id>637942ac8e093163742d7b74bf80836c3b950c4e</id>
<content type='text'>
Set ubconfig to None and add a check in the show_timings() function of
test/py/test.py to ensure that the global ubconfig variable was actually
initialized before access attributes.

If tests fail early, e.g. because --build failed, ubconfig may not have
been initialized yet and results in an exception in an atexit handler.
Adding this check avoids unnecessary noise in the output.

    Exception ignored in atexit callback: &lt;function cleanup at 0x7de475ea6b60&gt;
    Traceback (most recent call last):
    File "u-boot/test/py/conftest.py", line 669, in cleanup
        show_timings()
    File "u-boot/test/py/conftest.py", line 616, in show_timings
        if ubconfig.timing:
        ^^^^^^^^
    NameError: name 'ubconfig' is not defined

Tested-by: Mattijs Korpershoek &lt;mkorpershoek@kernel.org&gt; # sandbox
Reviewed-by: Mattijs Korpershoek &lt;mkorpershoek@kernel.org&gt;
Signed-off-by: David Lechner &lt;dlechner@baylibre.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Set ubconfig to None and add a check in the show_timings() function of
test/py/test.py to ensure that the global ubconfig variable was actually
initialized before access attributes.

If tests fail early, e.g. because --build failed, ubconfig may not have
been initialized yet and results in an exception in an atexit handler.
Adding this check avoids unnecessary noise in the output.

    Exception ignored in atexit callback: &lt;function cleanup at 0x7de475ea6b60&gt;
    Traceback (most recent call last):
    File "u-boot/test/py/conftest.py", line 669, in cleanup
        show_timings()
    File "u-boot/test/py/conftest.py", line 616, in show_timings
        if ubconfig.timing:
        ^^^^^^^^
    NameError: name 'ubconfig' is not defined

Tested-by: Mattijs Korpershoek &lt;mkorpershoek@kernel.org&gt; # sandbox
Reviewed-by: Mattijs Korpershoek &lt;mkorpershoek@kernel.org&gt;
Signed-off-by: David Lechner &lt;dlechner@baylibre.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>test/py: Correct handling of exceptions</title>
<updated>2025-06-12T17:32:29+00:00</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2025-05-29T14:14:52+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=2ab10ed2399b0c1c790733884935c94ad65aa2a8'/>
<id>2ab10ed2399b0c1c790733884935c94ad65aa2a8</id>
<content type='text'>
If an Unexpected exception is thrown in a test, an undefined variable
error is reported. Fix this.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
Fixes: 85d7dae377a ("test: Detect dead connections")
Reviewed-by: Mattijs Korpershoek &lt;mkorpershoek@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If an Unexpected exception is thrown in a test, an undefined variable
error is reported. Fix this.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
Fixes: 85d7dae377a ("test: Detect dead connections")
Reviewed-by: Mattijs Korpershoek &lt;mkorpershoek@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>test/py: Use the correct fixture name in exception handler</title>
<updated>2025-06-12T17:32:29+00:00</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2025-05-29T14:14:51+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=ef82e45c2ef5278493576708d6aafd686ba77af9'/>
<id>ef82e45c2ef5278493576708d6aafd686ba77af9</id>
<content type='text'>
If a BootFail exception is thrown in a test, it is not handled
correctly. Use the correct fixture variable 'ubman_fix' to resolve this.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
Fixes: d9ed4b75add ("test/py: Drop u_boot_ prefix on test files")
Reviewed-by: Mattijs Korpershoek &lt;mkorpershoek@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If a BootFail exception is thrown in a test, it is not handled
correctly. Use the correct fixture variable 'ubman_fix' to resolve this.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
Fixes: d9ed4b75add ("test/py: Drop u_boot_ prefix on test files")
Reviewed-by: Mattijs Korpershoek &lt;mkorpershoek@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>test: allow multiple config options in buildconfigspec</title>
<updated>2025-05-18T07:16:51+00:00</updated>
<author>
<name>Heinrich Schuchardt</name>
<email>heinrich.schuchardt@canonical.com</email>
</author>
<published>2025-05-03T13:31:54+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=2bac578c5abae233cc855f79791a2846c9a99518'/>
<id>2bac578c5abae233cc855f79791a2846c9a99518</id>
<content type='text'>
In some cases we have alternative configuration options that supply the
same functionality, e.g CONFIG_NET and CONFIG_NET_LWIP.

Allow to specify all of them as arguments for buildconfigspec() and execute
the text if any of these is fulfilled, e.g.

    @pytest.mark.buildconfigspec('net', 'net_lwip')

Update the documentation.

Signed-off-by: Heinrich Schuchardt &lt;heinrich.schuchardt@canonical.com&gt;
Acked-by: Jerome Forissier &lt;jerome.forissier@linaro.org&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In some cases we have alternative configuration options that supply the
same functionality, e.g CONFIG_NET and CONFIG_NET_LWIP.

Allow to specify all of them as arguments for buildconfigspec() and execute
the text if any of these is fulfilled, e.g.

    @pytest.mark.buildconfigspec('net', 'net_lwip')

Update the documentation.

Signed-off-by: Heinrich Schuchardt &lt;heinrich.schuchardt@canonical.com&gt;
Acked-by: Jerome Forissier &lt;jerome.forissier@linaro.org&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>test/py: Allow tests to be filtered by role</title>
<updated>2025-04-03T17:41:55+00:00</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2025-03-15T14:25:51+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=9a04b9a4392fc0ee49596bb63b7706beb29034de'/>
<id>9a04b9a4392fc0ee49596bb63b7706beb29034de</id>
<content type='text'>
Some test can only be run by a particular board in a lab, e.g. because
they are loaded with an OS image used by the test. Add a way to specify
this in tests.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Some test can only be run by a particular board in a lab, e.g. because
they are loaded with an OS image used by the test. Add a way to specify
this in tests.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>test/py: Show info about module-loading</title>
<updated>2025-03-15T11:47:05+00:00</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2025-02-09T16:07:18+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=0043428777f8b4dabd8124aa60f53fc7a14c9369'/>
<id>0043428777f8b4dabd8124aa60f53fc7a14c9369</id>
<content type='text'>
It is sometimes tricky to figure out what modules test.py is loading
when it starts up. The result can be a silent failure with no clue as to
what when wrong.

Add a section which lists the modules loaded as well as those not
found.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It is sometimes tricky to figure out what modules test.py is loading
when it starts up. The result can be a silent failure with no clue as to
what when wrong.

Add a section which lists the modules loaded as well as those not
found.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>test/py: Drop u_boot_ prefix on test files</title>
<updated>2025-03-15T11:02:04+00:00</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2025-02-09T16:07:15+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=d9ed4b75add4b4ccc37cf32b54cd9c77f48e3396'/>
<id>d9ed4b75add4b4ccc37cf32b54cd9c77f48e3396</id>
<content type='text'>
We know this is U-Boot so the prefix serves no purpose other than to
make things longer and harder to read. Drop it and rename the files.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
Reviewed-by: Mattijs Korpershoek &lt;mkorpershoek@baylibre.com&gt; # test_android / test_dfu
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We know this is U-Boot so the prefix serves no purpose other than to
make things longer and harder to read. Drop it and rename the files.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
Reviewed-by: Mattijs Korpershoek &lt;mkorpershoek@baylibre.com&gt; # test_android / test_dfu
</pre>
</div>
</content>
</entry>
<entry>
<title>test/py: Shorten u_boot_console</title>
<updated>2025-03-15T10:38:38+00:00</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2025-02-09T16:07:14+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=752c3769874596d012cd8325099d2ae20123f989'/>
<id>752c3769874596d012cd8325099d2ae20123f989</id>
<content type='text'>
This fixture name is quite long and results in lots of verbose code.
We know this is U-Boot so the 'u_boot_' part is not necessary.

But it is also a bit of a misnomer, since it provides access to all the
information available to tests. It is not just the console.

It would be too confusing to use con as it would be confused with
config and it is probably too short.

So shorten it to 'ubman'.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
Link: https://lore.kernel.org/u-boot/CAFLszTgPa4aT_J9h9pqeTtLCVn4x2JvLWRcWRD8NaN3uoSAtyA@mail.gmail.com/
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This fixture name is quite long and results in lots of verbose code.
We know this is U-Boot so the 'u_boot_' part is not necessary.

But it is also a bit of a misnomer, since it provides access to all the
information available to tests. It is not just the console.

It would be too confusing to use con as it would be confused with
config and it is probably too short.

So shorten it to 'ubman'.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
Link: https://lore.kernel.org/u-boot/CAFLszTgPa4aT_J9h9pqeTtLCVn4x2JvLWRcWRD8NaN3uoSAtyA@mail.gmail.com/
</pre>
</div>
</content>
</entry>
<entry>
<title>test/py: Add a report show test durations</title>
<updated>2025-01-30T20:34:51+00:00</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2025-01-27T14:52:54+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=5e46a06950a9bc6a4e70e20b90a903fe55eca025'/>
<id>5e46a06950a9bc6a4e70e20b90a903fe55eca025</id>
<content type='text'>
Execution time varies widely with the existing tests. Provides a way to
produce a summary of the time taken for each test, along with a
histogram.

This is enabled with the --timing flag.

Enable it for sandbox in CI.

Example:

   Duration : Number of tests
   ======== : ========================================
       &lt;1ms :  1
       &lt;8ms :  1
      &lt;20ms : # 20
      &lt;30ms : ######## 127
      &lt;50ms : ######################################## 582
      &lt;75ms : ####### 102
     &lt;100ms : ## 39
     &lt;200ms : ##### 86
     &lt;300ms : # 29
     &lt;500ms : ## 42
     &lt;750ms : # 16
      &lt;1.0s : # 15
      &lt;2.0s : # 23
      &lt;3.0s :  13
      &lt;5.0s :  9
      &lt;7.5s :  1
     &lt;10.0s :  6
     &lt;20.0s :  12

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
Reviewed-by: Tom Rini &lt;trini@konsulko.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Execution time varies widely with the existing tests. Provides a way to
produce a summary of the time taken for each test, along with a
histogram.

This is enabled with the --timing flag.

Enable it for sandbox in CI.

Example:

   Duration : Number of tests
   ======== : ========================================
       &lt;1ms :  1
       &lt;8ms :  1
      &lt;20ms : # 20
      &lt;30ms : ######## 127
      &lt;50ms : ######################################## 582
      &lt;75ms : ####### 102
     &lt;100ms : ## 39
     &lt;200ms : ##### 86
     &lt;300ms : # 29
     &lt;500ms : ## 42
     &lt;750ms : # 16
      &lt;1.0s : # 15
      &lt;2.0s : # 23
      &lt;3.0s :  13
      &lt;5.0s :  9
      &lt;7.5s :  1
     &lt;10.0s :  6
     &lt;20.0s :  12

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
Reviewed-by: Tom Rini &lt;trini@konsulko.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
