History log of /u-boot/test/ut.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 30a75e77 01-Oct-2023 Simon Glass <sjg@chromium.org>

test: Add helper to skip to partial console line

Sometimes we need to skip to a line but it includes addresses or other
information which can vary depending on the runtime conditions.

Add a new ut_assert_skip_to_linen() which is similar to the existing
ut_assert_skip_to_line() function but only checks that the console line
matches up to the length of the provided string.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 2e09008c 18-Aug-2021 Simon Glass <sjg@chromium.org>

test: Add a way to skip console checking until a string matches

Some tests produce a lot of output that does not need to be individually
checked by an assertion. Add a macro to handle this.

Signed-off-by: Simon Glass <sjg@chromium.org>

# c7b16d83 08-May-2021 Simon Glass <sjg@chromium.org>

display_options: Drop two spaces before the ASCII column

At present with print_buffer() U-Boot shows four spaces between the hex
and ASCII data. Two seems enough and matches print_hex_dump(). Change it.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 090d664e 08-May-2021 Simon Glass <sjg@chromium.org>

test: Detect when expect_str is too small

If a line of more than 256 bytes is generated, the test will fail but the
reason is not clear. Add a check for this condition and print a helpful
message.

Signed-off-by: Simon Glass <sjg@chromium.org>

# c1a2bb4f 08-May-2021 Simon Glass <sjg@chromium.org>

console: Report an error when output buffer is exhausted

If the console output buffer is exhausted, characters are silently dropped
from the end. Detect this condition and report an error when reading back
the characters.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 47ec3ede 07-Mar-2021 Simon Glass <sjg@chromium.org>

test: Move delay skipping to test_pre_run()

This allows delays to be skipped in sandbox tests. Move it to the
common pre-init function.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>

# ef7e2649 08-Nov-2020 Simon Glass <sjg@chromium.org>

test: Avoid assuming sandbox board for bloblist test

This tests assumes it is running on sandbox. Add a few functions to handle
silencing the console on any board and use those instead.

Reported-by: Kever Yang <kever.yang@rock-chips.com>

Signed-off-by: Simon Glass <sjg@chromium.org>

# 33d7edfd 28-Jul-2020 Simon Glass <sjg@chromium.org>

test: Add a way to check part of a console line or skip it

Some lines of the output are not worth testing, or not worth testing in
their entirety. For example, when checking a hex dump we know that the
hex-dump routine can display ASCII so we only need to check the hex bytes,
not the ASCII dump. Add a new test macros which can check only part of
a console line.

Sometimes it is useful to skip a line altogether, so add a macro for that
also.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 400175b0 27-Jan-2020 Simon Glass <sjg@chromium.org>

test: Add a way to check each line of console output

When writing tests to check the output from commands it is useful to be
able to check the output line by line using an assertion. Add helper
macros to support this and to check that there is no unexpected trailing
data.

Also some commands produce a dump using print_buffer(). Add a way to check
that the correct number of bytes are dumped (ignoring the actual
contents).

Signed-off-by: Simon Glass <sjg@chromium.org>

# 8109863f 29-Dec-2019 Simon Glass <sjg@chromium.org>

test: Add functions to find the amount of allocated memory

The malloc() implementations provides a way of finding out the approximate
amount of memory that is allocated. Add helper functions to make it easier
to access this and see changes over time. This is useful for tests that
want to check if memory has been allocated or freed.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 83d290c5 06-May-2018 Tom Rini <trini@konsulko.com>

SPDX: Convert all of our single license tags to Linux Kernel style

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>

# 9ce8b402 08-Nov-2015 Simon Glass <sjg@chromium.org>

test: Record and silence console in tests

When running sandbox tests, silence the console to avoid unwanted output.
Also, record the console in case tests want to check it.

The -v option can be used to enable stdout during tests.

Signed-off-by: Simon Glass <sjg@chromium.org>

# e721b882 20-May-2015 Joe Hershberger <joe.hershberger@ni.com>

test: Generalize the unit test framework

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>

# 2e09008c 18-Aug-2021 Simon Glass <sjg@chromium.org>

test: Add a way to skip console checking until a string matches

Some tests produce a lot of output that does not need to be individually
checked by an assertion. Add a macro to handle this.

Signed-off-by: Simon Glass <sjg@chromium.org>

# c7b16d83 08-May-2021 Simon Glass <sjg@chromium.org>

display_options: Drop two spaces before the ASCII column

At present with print_buffer() U-Boot shows four spaces between the hex
and ASCII data. Two seems enough and matches print_hex_dump(). Change it.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 090d664e 08-May-2021 Simon Glass <sjg@chromium.org>

test: Detect when expect_str is too small

If a line of more than 256 bytes is generated, the test will fail but the
reason is not clear. Add a check for this condition and print a helpful
message.

Signed-off-by: Simon Glass <sjg@chromium.org>

# c1a2bb4f 08-May-2021 Simon Glass <sjg@chromium.org>

console: Report an error when output buffer is exhausted

If the console output buffer is exhausted, characters are silently dropped
from the end. Detect this condition and report an error when reading back
the characters.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 47ec3ede 07-Mar-2021 Simon Glass <sjg@chromium.org>

test: Move delay skipping to test_pre_run()

This allows delays to be skipped in sandbox tests. Move it to the
common pre-init function.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>

# ef7e2649 08-Nov-2020 Simon Glass <sjg@chromium.org>

test: Avoid assuming sandbox board for bloblist test

This tests assumes it is running on sandbox. Add a few functions to handle
silencing the console on any board and use those instead.

Reported-by: Kever Yang <kever.yang@rock-chips.com>

Signed-off-by: Simon Glass <sjg@chromium.org>

# 33d7edfd 28-Jul-2020 Simon Glass <sjg@chromium.org>

test: Add a way to check part of a console line or skip it

Some lines of the output are not worth testing, or not worth testing in
their entirety. For example, when checking a hex dump we know that the
hex-dump routine can display ASCII so we only need to check the hex bytes,
not the ASCII dump. Add a new test macros which can check only part of
a console line.

Sometimes it is useful to skip a line altogether, so add a macro for that
also.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 400175b0 27-Jan-2020 Simon Glass <sjg@chromium.org>

test: Add a way to check each line of console output

When writing tests to check the output from commands it is useful to be
able to check the output line by line using an assertion. Add helper
macros to support this and to check that there is no unexpected trailing
data.

Also some commands produce a dump using print_buffer(). Add a way to check
that the correct number of bytes are dumped (ignoring the actual
contents).

Signed-off-by: Simon Glass <sjg@chromium.org>

# 8109863f 29-Dec-2019 Simon Glass <sjg@chromium.org>

test: Add functions to find the amount of allocated memory

The malloc() implementations provides a way of finding out the approximate
amount of memory that is allocated. Add helper functions to make it easier
to access this and see changes over time. This is useful for tests that
want to check if memory has been allocated or freed.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 83d290c5 06-May-2018 Tom Rini <trini@konsulko.com>

SPDX: Convert all of our single license tags to Linux Kernel style

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>

# 9ce8b402 08-Nov-2015 Simon Glass <sjg@chromium.org>

test: Record and silence console in tests

When running sandbox tests, silence the console to avoid unwanted output.
Also, record the console in case tests want to check it.

The -v option can be used to enable stdout during tests.

Signed-off-by: Simon Glass <sjg@chromium.org>

# e721b882 20-May-2015 Joe Hershberger <joe.hershberger@ni.com>

test: Generalize the unit test framework

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>

# c7b16d83 08-May-2021 Simon Glass <sjg@chromium.org>

display_options: Drop two spaces before the ASCII column

At present with print_buffer() U-Boot shows four spaces between the hex
and ASCII data. Two seems enough and matches print_hex_dump(). Change it.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 090d664e 08-May-2021 Simon Glass <sjg@chromium.org>

test: Detect when expect_str is too small

If a line of more than 256 bytes is generated, the test will fail but the
reason is not clear. Add a check for this condition and print a helpful
message.

Signed-off-by: Simon Glass <sjg@chromium.org>

# c1a2bb4f 08-May-2021 Simon Glass <sjg@chromium.org>

console: Report an error when output buffer is exhausted

If the console output buffer is exhausted, characters are silently dropped
from the end. Detect this condition and report an error when reading back
the characters.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 47ec3ede 07-Mar-2021 Simon Glass <sjg@chromium.org>

test: Move delay skipping to test_pre_run()

This allows delays to be skipped in sandbox tests. Move it to the
common pre-init function.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>

# ef7e2649 08-Nov-2020 Simon Glass <sjg@chromium.org>

test: Avoid assuming sandbox board for bloblist test

This tests assumes it is running on sandbox. Add a few functions to handle
silencing the console on any board and use those instead.

Reported-by: Kever Yang <kever.yang@rock-chips.com>

Signed-off-by: Simon Glass <sjg@chromium.org>

# 33d7edfd 28-Jul-2020 Simon Glass <sjg@chromium.org>

test: Add a way to check part of a console line or skip it

Some lines of the output are not worth testing, or not worth testing in
their entirety. For example, when checking a hex dump we know that the
hex-dump routine can display ASCII so we only need to check the hex bytes,
not the ASCII dump. Add a new test macros which can check only part of
a console line.

Sometimes it is useful to skip a line altogether, so add a macro for that
also.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 400175b0 27-Jan-2020 Simon Glass <sjg@chromium.org>

test: Add a way to check each line of console output

When writing tests to check the output from commands it is useful to be
able to check the output line by line using an assertion. Add helper
macros to support this and to check that there is no unexpected trailing
data.

Also some commands produce a dump using print_buffer(). Add a way to check
that the correct number of bytes are dumped (ignoring the actual
contents).

Signed-off-by: Simon Glass <sjg@chromium.org>

# 8109863f 29-Dec-2019 Simon Glass <sjg@chromium.org>

test: Add functions to find the amount of allocated memory

The malloc() implementations provides a way of finding out the approximate
amount of memory that is allocated. Add helper functions to make it easier
to access this and see changes over time. This is useful for tests that
want to check if memory has been allocated or freed.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 83d290c5 06-May-2018 Tom Rini <trini@konsulko.com>

SPDX: Convert all of our single license tags to Linux Kernel style

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>

# 9ce8b402 08-Nov-2015 Simon Glass <sjg@chromium.org>

test: Record and silence console in tests

When running sandbox tests, silence the console to avoid unwanted output.
Also, record the console in case tests want to check it.

The -v option can be used to enable stdout during tests.

Signed-off-by: Simon Glass <sjg@chromium.org>

# e721b882 20-May-2015 Joe Hershberger <joe.hershberger@ni.com>

test: Generalize the unit test framework

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>

# 47ec3ede 07-Mar-2021 Simon Glass <sjg@chromium.org>

test: Move delay skipping to test_pre_run()

This allows delays to be skipped in sandbox tests. Move it to the
common pre-init function.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>

# ef7e2649 08-Nov-2020 Simon Glass <sjg@chromium.org>

test: Avoid assuming sandbox board for bloblist test

This tests assumes it is running on sandbox. Add a few functions to handle
silencing the console on any board and use those instead.

Reported-by: Kever Yang <kever.yang@rock-chips.com>

Signed-off-by: Simon Glass <sjg@chromium.org>

# 33d7edfd 28-Jul-2020 Simon Glass <sjg@chromium.org>

test: Add a way to check part of a console line or skip it

Some lines of the output are not worth testing, or not worth testing in
their entirety. For example, when checking a hex dump we know that the
hex-dump routine can display ASCII so we only need to check the hex bytes,
not the ASCII dump. Add a new test macros which can check only part of
a console line.

Sometimes it is useful to skip a line altogether, so add a macro for that
also.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 400175b0 27-Jan-2020 Simon Glass <sjg@chromium.org>

test: Add a way to check each line of console output

When writing tests to check the output from commands it is useful to be
able to check the output line by line using an assertion. Add helper
macros to support this and to check that there is no unexpected trailing
data.

Also some commands produce a dump using print_buffer(). Add a way to check
that the correct number of bytes are dumped (ignoring the actual
contents).

Signed-off-by: Simon Glass <sjg@chromium.org>

# 8109863f 29-Dec-2019 Simon Glass <sjg@chromium.org>

test: Add functions to find the amount of allocated memory

The malloc() implementations provides a way of finding out the approximate
amount of memory that is allocated. Add helper functions to make it easier
to access this and see changes over time. This is useful for tests that
want to check if memory has been allocated or freed.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 83d290c5 06-May-2018 Tom Rini <trini@konsulko.com>

SPDX: Convert all of our single license tags to Linux Kernel style

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>

# 9ce8b402 08-Nov-2015 Simon Glass <sjg@chromium.org>

test: Record and silence console in tests

When running sandbox tests, silence the console to avoid unwanted output.
Also, record the console in case tests want to check it.

The -v option can be used to enable stdout during tests.

Signed-off-by: Simon Glass <sjg@chromium.org>

# e721b882 20-May-2015 Joe Hershberger <joe.hershberger@ni.com>

test: Generalize the unit test framework

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>

# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>

# ef7e2649 08-Nov-2020 Simon Glass <sjg@chromium.org>

test: Avoid assuming sandbox board for bloblist test

This tests assumes it is running on sandbox. Add a few functions to handle
silencing the console on any board and use those instead.

Reported-by: Kever Yang <kever.yang@rock-chips.com>

Signed-off-by: Simon Glass <sjg@chromium.org>

# 33d7edfd 28-Jul-2020 Simon Glass <sjg@chromium.org>

test: Add a way to check part of a console line or skip it

Some lines of the output are not worth testing, or not worth testing in
their entirety. For example, when checking a hex dump we know that the
hex-dump routine can display ASCII so we only need to check the hex bytes,
not the ASCII dump. Add a new test macros which can check only part of
a console line.

Sometimes it is useful to skip a line altogether, so add a macro for that
also.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 400175b0 27-Jan-2020 Simon Glass <sjg@chromium.org>

test: Add a way to check each line of console output

When writing tests to check the output from commands it is useful to be
able to check the output line by line using an assertion. Add helper
macros to support this and to check that there is no unexpected trailing
data.

Also some commands produce a dump using print_buffer(). Add a way to check
that the correct number of bytes are dumped (ignoring the actual
contents).

Signed-off-by: Simon Glass <sjg@chromium.org>

# 8109863f 29-Dec-2019 Simon Glass <sjg@chromium.org>

test: Add functions to find the amount of allocated memory

The malloc() implementations provides a way of finding out the approximate
amount of memory that is allocated. Add helper functions to make it easier
to access this and see changes over time. This is useful for tests that
want to check if memory has been allocated or freed.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 83d290c5 06-May-2018 Tom Rini <trini@konsulko.com>

SPDX: Convert all of our single license tags to Linux Kernel style

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>

# 9ce8b402 08-Nov-2015 Simon Glass <sjg@chromium.org>

test: Record and silence console in tests

When running sandbox tests, silence the console to avoid unwanted output.
Also, record the console in case tests want to check it.

The -v option can be used to enable stdout during tests.

Signed-off-by: Simon Glass <sjg@chromium.org>

# e721b882 20-May-2015 Joe Hershberger <joe.hershberger@ni.com>

test: Generalize the unit test framework

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>

# ef7e2649 08-Nov-2020 Simon Glass <sjg@chromium.org>

test: Avoid assuming sandbox board for bloblist test

This tests assumes it is running on sandbox. Add a few functions to handle
silencing the console on any board and use those instead.

Reported-by: Kever Yang <kever.yang@rock-chips.com>

Signed-off-by: Simon Glass <sjg@chromium.org>

# 33d7edfd 28-Jul-2020 Simon Glass <sjg@chromium.org>

test: Add a way to check part of a console line or skip it

Some lines of the output are not worth testing, or not worth testing in
their entirety. For example, when checking a hex dump we know that the
hex-dump routine can display ASCII so we only need to check the hex bytes,
not the ASCII dump. Add a new test macros which can check only part of
a console line.

Sometimes it is useful to skip a line altogether, so add a macro for that
also.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 400175b0 27-Jan-2020 Simon Glass <sjg@chromium.org>

test: Add a way to check each line of console output

When writing tests to check the output from commands it is useful to be
able to check the output line by line using an assertion. Add helper
macros to support this and to check that there is no unexpected trailing
data.

Also some commands produce a dump using print_buffer(). Add a way to check
that the correct number of bytes are dumped (ignoring the actual
contents).

Signed-off-by: Simon Glass <sjg@chromium.org>

# 8109863f 29-Dec-2019 Simon Glass <sjg@chromium.org>

test: Add functions to find the amount of allocated memory

The malloc() implementations provides a way of finding out the approximate
amount of memory that is allocated. Add helper functions to make it easier
to access this and see changes over time. This is useful for tests that
want to check if memory has been allocated or freed.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 83d290c5 06-May-2018 Tom Rini <trini@konsulko.com>

SPDX: Convert all of our single license tags to Linux Kernel style

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>

# 9ce8b402 08-Nov-2015 Simon Glass <sjg@chromium.org>

test: Record and silence console in tests

When running sandbox tests, silence the console to avoid unwanted output.
Also, record the console in case tests want to check it.

The -v option can be used to enable stdout during tests.

Signed-off-by: Simon Glass <sjg@chromium.org>

# e721b882 20-May-2015 Joe Hershberger <joe.hershberger@ni.com>

test: Generalize the unit test framework

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>

# 33d7edfd 28-Jul-2020 Simon Glass <sjg@chromium.org>

test: Add a way to check part of a console line or skip it

Some lines of the output are not worth testing, or not worth testing in
their entirety. For example, when checking a hex dump we know that the
hex-dump routine can display ASCII so we only need to check the hex bytes,
not the ASCII dump. Add a new test macros which can check only part of
a console line.

Sometimes it is useful to skip a line altogether, so add a macro for that
also.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 400175b0 27-Jan-2020 Simon Glass <sjg@chromium.org>

test: Add a way to check each line of console output

When writing tests to check the output from commands it is useful to be
able to check the output line by line using an assertion. Add helper
macros to support this and to check that there is no unexpected trailing
data.

Also some commands produce a dump using print_buffer(). Add a way to check
that the correct number of bytes are dumped (ignoring the actual
contents).

Signed-off-by: Simon Glass <sjg@chromium.org>

# 8109863f 29-Dec-2019 Simon Glass <sjg@chromium.org>

test: Add functions to find the amount of allocated memory

The malloc() implementations provides a way of finding out the approximate
amount of memory that is allocated. Add helper functions to make it easier
to access this and see changes over time. This is useful for tests that
want to check if memory has been allocated or freed.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 83d290c5 06-May-2018 Tom Rini <trini@konsulko.com>

SPDX: Convert all of our single license tags to Linux Kernel style

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>

# 9ce8b402 08-Nov-2015 Simon Glass <sjg@chromium.org>

test: Record and silence console in tests

When running sandbox tests, silence the console to avoid unwanted output.
Also, record the console in case tests want to check it.

The -v option can be used to enable stdout during tests.

Signed-off-by: Simon Glass <sjg@chromium.org>

# e721b882 20-May-2015 Joe Hershberger <joe.hershberger@ni.com>

test: Generalize the unit test framework

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>

# 400175b0 27-Jan-2020 Simon Glass <sjg@chromium.org>

test: Add a way to check each line of console output

When writing tests to check the output from commands it is useful to be
able to check the output line by line using an assertion. Add helper
macros to support this and to check that there is no unexpected trailing
data.

Also some commands produce a dump using print_buffer(). Add a way to check
that the correct number of bytes are dumped (ignoring the actual
contents).

Signed-off-by: Simon Glass <sjg@chromium.org>

# 8109863f 29-Dec-2019 Simon Glass <sjg@chromium.org>

test: Add functions to find the amount of allocated memory

The malloc() implementations provides a way of finding out the approximate
amount of memory that is allocated. Add helper functions to make it easier
to access this and see changes over time. This is useful for tests that
want to check if memory has been allocated or freed.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 83d290c5 06-May-2018 Tom Rini <trini@konsulko.com>

SPDX: Convert all of our single license tags to Linux Kernel style

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>

# 9ce8b402 08-Nov-2015 Simon Glass <sjg@chromium.org>

test: Record and silence console in tests

When running sandbox tests, silence the console to avoid unwanted output.
Also, record the console in case tests want to check it.

The -v option can be used to enable stdout during tests.

Signed-off-by: Simon Glass <sjg@chromium.org>

# e721b882 20-May-2015 Joe Hershberger <joe.hershberger@ni.com>

test: Generalize the unit test framework

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>

# 8109863f 29-Dec-2019 Simon Glass <sjg@chromium.org>

test: Add functions to find the amount of allocated memory

The malloc() implementations provides a way of finding out the approximate
amount of memory that is allocated. Add helper functions to make it easier
to access this and see changes over time. This is useful for tests that
want to check if memory has been allocated or freed.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 83d290c5 06-May-2018 Tom Rini <trini@konsulko.com>

SPDX: Convert all of our single license tags to Linux Kernel style

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>

# 9ce8b402 08-Nov-2015 Simon Glass <sjg@chromium.org>

test: Record and silence console in tests

When running sandbox tests, silence the console to avoid unwanted output.
Also, record the console in case tests want to check it.

The -v option can be used to enable stdout during tests.

Signed-off-by: Simon Glass <sjg@chromium.org>

# e721b882 20-May-2015 Joe Hershberger <joe.hershberger@ni.com>

test: Generalize the unit test framework

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>

# 83d290c5 06-May-2018 Tom Rini <trini@konsulko.com>

SPDX: Convert all of our single license tags to Linux Kernel style

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>


# 9ce8b402 08-Nov-2015 Simon Glass <sjg@chromium.org>

test: Record and silence console in tests

When running sandbox tests, silence the console to avoid unwanted output.
Also, record the console in case tests want to check it.

The -v option can be used to enable stdout during tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# e721b882 20-May-2015 Joe Hershberger <joe.hershberger@ni.com>

test: Generalize the unit test framework

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>