Commit Graph

39 Commits

Author SHA1 Message Date
Yu-Ping Wu 00c834dc26 lib: Fix log2_ceil() for 0xffffffff
Current log2_ceil(x) is defined as log2(x * 2 - 1). When x is larger
than (1 << 31), (x * 2 - 1) won't fit in u32, leading to incorrect
result. Therefore, correct it as (log2(x - 1) + 1). Also add unit tests
for inline functions in lib.h.

BUG=none
TEST=make tests/lib/lib-test
BRANCH=none

Change-Id: If868f793b909a6ad7fc48a7affac15e2c714fa2e
Signed-off-by: Yu-Ping Wu <yupingso@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59834
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
2021-12-08 00:51:43 +00:00
Subrata Banik 6de8b42482 arch/x86: Refactor the SMBIOS type 17 write function
List of changes:
1. Create Module Type macros as per Memory Type
(i.e. DDR2/DDR3/DDR4/DDR5/LPDDR4/LPDDR5) and fix compilation
issue due to renaming of existing macros due to scoping the Memory
Type.
2. Use dedicated Memory Type and Module type for `Form Factor`
and `TypeDetail` conversion using `get_spd_info()` function.
3. Create a new API (convert_form_factor_to_module_type()) for
`Form Factor` to 'Module type' conversion as per `Memory Type`.
4. Add new argument as `Memory Type` to
smbios_form_factor_to_spd_mod_type() so that it can internally
call convert_form_factor_to_module_type() for `Module Type`
conversion.
5. Update `test_smbios_form_factor_to_spd_mod_type()` to
accommodate different memory types.
6. Skip fixed module type to form factor conversion using DDR2 SPD4
specification (inside dimm_info_fill()).

Refer to datasheet SPD4.1.2.M-1 for LPDDRx and SPD4.1.2.L-3 for DDRx.

BUG=b:194659789
TEST=Refer to dmidecode -t 17 output as below:
Without this code change:

Handle 0x0012, DMI type 17, 40 bytes
Memory Device
        Array Handle: 0x000A
        Error Information Handle: Not Provided
        Total Width: 16 bits
        Data Width: 16 bits
        Size: 2048 MB
        Form Factor: Unknown
        ....

With this code change:

Handle 0x0012, DMI type 17, 40 bytes
Memory Device
        Array Handle: 0x000A
        Error Information Handle: Not Provided
        Total Width: 16 bits
        Data Width: 16 bits
        Size: 2048 MB
        Form Factor: Row Of Chips
        ....

Change-Id: Ia337ac8f50b61ae78d86a07c7a86aa9c248bad50
Signed-off-by: Subrata Banik <subrata.banik@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/56628
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Jakub Czapiga <jacz@semihalf.com>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
2021-11-11 09:10:10 +00:00
Jakub Czapiga c1e4c5aaa5 tests: Add lib/lzma-test test case
Files used by this test are in: tests/data/lib/lzma-test/
file.bin - files with uncompressed data
file.lzma.bin - files with LZMA-compressed data from file.bin

How to prepare compressed file:
  util/cbfs-compression-tool compress file.bin /tmp/file.lzma.bin lzma
  dd if=/tmp/file.lzma.bin of=file.lzma.bin skip=8 ibs=1

Signed-off-by: Jakub Czapiga <jacz@semihalf.com>
Change-Id: Id75e0b41991382d4c391b031862106de58eacdf7
Reviewed-on: https://review.coreboot.org/c/coreboot/+/57555
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
2021-10-14 13:13:07 +00:00
Jakub Czapiga b20aa094cc tests: Add lib/cbfs-lookup-test test case
Signed-off-by: Jakub Czapiga <jacz@semihalf.com>
Change-Id: I2ebebba1468c19661741de8a8456605b1c5f56b6
Reviewed-on: https://review.coreboot.org/c/coreboot/+/56813
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
2021-09-14 23:35:38 +00:00
Jakub Czapiga 6f3fd6358f tests: Add lib/cbfs-verification-test test case
This commit adds test case for lib/cbfs verification mechanisms.

Signed-off-by: Jakub Czapiga <jacz@semihalf.com>
Change-Id: I1d8cbb1c2d0a9db3236de065428b70a9c2a66330
Reviewed-on: https://review.coreboot.org/c/coreboot/+/56601
Reviewed-by: Julius Werner <jwerner@chromium.org>
Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2021-09-02 00:31:02 +00:00
Jakub Czapiga d0bd012b5e tests/Makefile.inc: Add missing include paths to TEST_CFLAGS
Add missing paths to common tests cflags and remove these paths from
individual tests configuration.

Signed-off-by: Jakub Czapiga <jacz@semihalf.com>
Change-Id: I13cb336195bfb06b861d7f403822f06bec8a40aa
Reviewed-on: https://review.coreboot.org/c/coreboot/+/56933
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
2021-08-13 18:05:55 +00:00
Jakub Czapiga ca3aa52cf8 tests: Add lib/libgcc-test test case
Add tests for src/lib/libgcc.c __clzsi2() implementation. Unlike GCC
implementation, coreboot one can handle zero input.

Signed-off-by: Jakub Czapiga <jacz@semihalf.com>
Change-Id: I3f46071d0921e8c5edc5df3c296d11c77de01c88
Reviewed-on: https://review.coreboot.org/c/coreboot/+/56257
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
2021-07-26 07:32:43 +00:00
Jakub Czapiga db4b21a1d0 tests: Add lib/cbmem_stage_cache-test test case
Signed-off-by: Jakub Czapiga <jacz@semihalf.com>
Change-Id: Ie6851b9473b225beb5ba51e26f44e21ea5919a64
Reviewed-on: https://review.coreboot.org/c/coreboot/+/54916
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
2021-06-01 16:10:42 +00:00
Jakub Czapiga 2b8d7216ef tests: Add lib/spd_cache-test test case
Signed-off-by: Jakub Czapiga <jacz@semihalf.com>
Change-Id: Ic9a1420e49e1e80d180117c931e630e54c90cd75
Reviewed-on: https://review.coreboot.org/c/coreboot/+/52938
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
2021-05-14 08:59:29 +00:00
Jakub Czapiga a37c8021a6 tests: Add lib/rtc-test test case
Signed-off-by: Jakub Czapiga <jacz@semihalf.com>
Change-Id: I2062e0d9dc2018bd6d8a210c8d26f2091e8c03fe
Reviewed-on: https://review.coreboot.org/c/coreboot/+/52414
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
2021-04-21 09:18:56 +00:00
Jakub Czapiga 5d884837f4 tests: Add lib/coreboot_table-test test case
Signed-off-by: Jakub Czapiga <jacz@semihalf.com>
Change-Id: I4d7d9ca43316bf514bb5ebd8909f441bcfa20eba
Reviewed-on: https://review.coreboot.org/c/coreboot/+/52159
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
2021-04-18 20:43:05 +00:00
Jakub Czapiga dadcae63c6 tests: Add lib/dimm_info_util-test test case
Signed-off-by: Jakub Czapiga <jacz@semihalf.com>
Change-Id: I536566ba883bbeb558587a8d71e3d86152fb5e14
Reviewed-on: https://review.coreboot.org/c/coreboot/+/52192
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2021-04-15 07:38:05 +00:00
Jan Dabros 935769398a tests: Add lib/bootmem-test test case
Signed-off-by: Jan Dabros <jsd@semihalf.com>
Signed-off-by: Jakub Czapiga <jacz@semihalf.com>
Change-Id: Ic1e539061ee5051d4158712a8a981a475ea7458a
Reviewed-on: https://review.coreboot.org/c/coreboot/+/43510
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
2021-04-09 06:20:50 +00:00
Jakub Czapiga f5c0021e05 tests: Add lib/uuid-test test case
Signed-off-by: Jakub Czapiga <jacz@semihalf.com>
Change-Id: I7f8498ad3d9d0d68b34aa0b48daca60545ec3f4e
Reviewed-on: https://review.coreboot.org/c/coreboot/+/51976
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
2021-04-06 06:56:47 +00:00
Jan Dabros 9e16ca9dec tests: Add lib/memrange-test test case
Signed-off-by: Jan Dabros <jsd@semihalf.com>
Signed-off-by: Jakub Czapiga <jacz@semihalf.com>
Change-Id: If30a238d32326ffd1d6719470deedc77f176ac72
Reviewed-on: https://review.coreboot.org/c/coreboot/+/43305
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
2021-03-15 06:10:24 +00:00
Jakub Czapiga 9f13cb72c5 tests: Add lib/compute_ip_checksum-test test case
Signed-off-by: Jakub Czapiga <jacz@semihalf.com>
Change-Id: I61c578ec93837cb2581a1ab9e2f3db2a0dd69f3d
Reviewed-on: https://review.coreboot.org/c/coreboot/+/51089
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
2021-03-02 17:04:44 +00:00
Jakub Czapiga 0b6b968f9e tests: Add lib/crc_byte-test test case
Signed-off-by: Jakub Czapiga <jacz@semihalf.com>
Change-Id: I9016cd7825cb681fd200b23dd362ca24acf69192
Reviewed-on: https://review.coreboot.org/c/coreboot/+/51088
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
2021-03-02 17:04:28 +00:00
Jakub Czapiga f5e636ccdb tests: Add lib/memmove-test test case
Signed-off-by: Jakub Czapiga <jacz@semihalf.com>
Change-Id: Ic9b68eb0fa85bbc3f66d57cdcb329073b26bea57
Reviewed-on: https://review.coreboot.org/c/coreboot/+/50902
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
2021-03-01 08:31:11 +00:00
Jakub Czapiga 7a18721cc7 tests: Add lib/malloc-test test case
Signed-off-by: Jakub Czapiga <jacz@semihalf.com>
Change-Id: Ic6b10ec382cc807772689e852bad300c75da1fe2
Reviewed-on: https://review.coreboot.org/c/coreboot/+/50715
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
2021-02-26 07:29:57 +00:00
Jakub Czapiga eb4bb6f563 tests: Add lib/memcpy-test test case
Signed-off-by: Jakub Czapiga <jacz@semihalf.com>
Change-Id: I00464ec2db23867712cd2efd7f6cad92e3ee361a
Reviewed-on: https://review.coreboot.org/c/coreboot/+/50799
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
2021-02-23 17:12:52 +00:00
Jakub Czapiga cc7acb82c0 tests: Add lib/memchr-test test case
Signed-off-by: Jakub Czapiga <jacz@semihalf.com>
Change-Id: Idcc824bfd9ca950f377c8f6a5916ffaba450fe73
Reviewed-on: https://review.coreboot.org/c/coreboot/+/50721
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
2021-02-22 07:31:06 +00:00
Jakub Czapiga c4ca8c3556 tests: Add lib/memcmp-test test case
Signed-off-by: Jakub Czapiga <jacz@semihalf.com>
Change-Id: Ib63123a36179127af4e3720ed01ca2611daa607e
Reviewed-on: https://review.coreboot.org/c/coreboot/+/50785
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
2021-02-18 19:12:46 +00:00
Jakub Czapiga 7a940dfb22 tests: Add lib/memset-test test case
Signed-off-by: Jakub Czapiga <jacz@semihalf.com>
Change-Id: I6750caa8ccdc442f78b782407ebfb3af78f476ce
Reviewed-on: https://review.coreboot.org/c/coreboot/+/50716
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
2021-02-18 10:14:21 +00:00
Jakub Czapiga b3a7c84b43 tests: Add lib/stack-test test case
Signed-off-by: Jakub Czapiga <jacz@semihalf.com>
Change-Id: Icf0cceac290618a50ecc4e65f1f9551dbf31bd32
Reviewed-on: https://review.coreboot.org/c/coreboot/+/50305
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
2021-02-12 07:48:24 +00:00
Jakub Czapiga eb6f80d049 tests: Add lib/region_file-test test case
Signed-off-by: Jakub Czapiga <jacz@semihalf.com>
Change-Id: Ic48e52a97b18d55fd983315f25dc972f472cc473
Reviewed-on: https://review.coreboot.org/c/coreboot/+/49669
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2021-02-02 18:05:26 +00:00
Jakub Czapiga a2b21c23d5 tests: Add lib/imd_cbmem-test test case
Signed-off-by: Jakub Czapiga <jacz@semihalf.com>
Change-Id: Ie893b5e8fc91c230ff96a14146085de16d78b1c1
Reviewed-on: https://review.coreboot.org/c/coreboot/+/46458
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
2021-01-18 07:27:16 +00:00
Jakub Czapiga dd85c82962 tests: Add lib/fmap-test test case
Signed-off-by: Jakub Czapiga <jacz@semihalf.com>
Change-Id: I885ea05d509d3b1330de7a18531f310d290c6965
Reviewed-on: https://review.coreboot.org/c/coreboot/+/48557
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
2021-01-08 08:26:26 +00:00
Jakub Czapiga ea378ccc8f tests: Add lib/list-test test case
Change-Id: If74f241b2bb788b3e2fd1b9062fc74819f7be31e
Signed-off-by: Jakub Czapiga <jacz@semihalf.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/47507
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
2020-11-25 09:14:07 +00:00
Jakub Czapiga f9961fff31 tests: Add lib/cbmem_console-test test case
Add test case executed twice, once for ROMSTAGE and once RAMSTAGE.
Each test is named and visible in cmocka output with stage in its name.

Signed-off-by: Jakub Czapiga <jacz@semihalf.com>
Change-Id: I464eee61f538188427bec730d2e004c7b76cca67
Reviewed-on: https://review.coreboot.org/c/coreboot/+/47642
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
2020-11-22 22:33:56 +00:00
Jakub Czapiga e0af9fcb2d tests: Add lib/edid-test test case
Signed-off-by: Jakub Czapiga <jacz@semihalf.com>
Change-Id: I796e660eebc4d2c3c32207bd3a6ee44aaffeb325
Reviewed-on: https://review.coreboot.org/c/coreboot/+/46817
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
2020-11-10 06:19:10 +00:00
Jakub Czapiga e0c60f3d39 tests: Add lib/timestamp-test test case
Signed-off-by: Jakub Czapiga <jacz@semihalf.com>
Change-Id: I39abfc644fef085cef2175086a0e45a040b244de
Reviewed-on: https://review.coreboot.org/c/coreboot/+/46968
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
2020-11-09 07:34:07 +00:00
Jakub Czapiga 466a378b9a tests: Add lib/imd-test test case
Implement unit tests for src/lib/imd.c module.

Signed-off-by: Jakub Czapiga <jacz@semihalf.com>
Signed-off-by: Anna Karas <aka@semihalf.com>
Signed-off-by: Jan Dabros <jsd@semihalf.com>
Change-Id: I3902f8638669440144064ce0e3756918338f4068
Reviewed-on: https://review.coreboot.org/c/coreboot/+/46457
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2020-10-26 06:55:46 +00:00
Anna Karas f7cd0d5a05 tests: Move the console stubs to a dedicated directory
Move the console functions definitions out from lib/b64_decode code to
a dedicated directory.

Signed-off-by: Anna Karas <aka@semihalf.com>
Change-Id: I22a6a592f0d4d509f19920f4ad2b18e8ed83a03e
Reviewed-on: https://review.coreboot.org/c/coreboot/+/43285
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
2020-07-12 19:38:28 +00:00
Anna Karas 5664bc8cf9 tests: Add lib/hexstrtobin-test test case
Implement unit tests for lib/hexstrtobin module.

Signed-off-by: Anna Karas <aka@semihalf.com>
Change-Id: Id929b07936ea180a798309e5acb1dacf1b396e32
Reviewed-on: https://review.coreboot.org/c/coreboot/+/43088
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
2020-07-07 17:26:42 +00:00
Anna Karas 072a9b96eb tests: Add lib/b64_decode-test test case
Implement unit tests for lib/b64_decode module.

Signed-off-by: Anna Karas <aka@semihalf.com>
Change-Id: Id5fe9272e30eaff3d086a95241b3819101089c2b
Reviewed-on: https://review.coreboot.org/c/coreboot/+/42313
Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2020-07-06 23:47:40 +00:00
Anna Karas a65afdb833 tests/lib/Makefile.inc: remove a comment
Remove a comment since is not useful anymore.

Signed-off-by: Anna Karas <aka@semihalf.com>
Change-Id: I236b040a83700bcd34d99db61e5dad0ff7abb28c
Reviewed-on: https://review.coreboot.org/c/coreboot/+/42312
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
2020-07-01 05:18:58 +00:00
Patrick Georgi 6b5bc77c9b treewide: Remove "this file is part of" lines
Stefan thinks they don't add value.

Command used:
sed -i -e '/file is part of /d' $(git grep "file is part of " |egrep ":( */\*.*\*/\$|#|;#|-- | *\* )" | cut -d: -f1 |grep -v crossgcc |grep -v gcov | grep -v /elf.h |grep -v nvramtool)

The exceptions are for:
 - crossgcc (patch file)
 - gcov (imported from gcc)
 - elf.h (imported from GNU's libc)
 - nvramtool (more complicated header)

The removed lines are:
-       fmt.Fprintln(f, "/* This file is part of the coreboot project. */")
-# This file is part of a set of unofficial pre-commit hooks available
-/* This file is part of coreboot */
-# This file is part of msrtool.
-/* This file is part of msrtool. */
- * This file is part of ncurses, designed to be appended after curses.h.in
-/* This file is part of pgtblgen. */
- * This file is part of the coreboot project.
- /* This file is part of the coreboot project. */
-#  This file is part of the coreboot project.
-# This file is part of the coreboot project.
-## This file is part of the coreboot project.
--- This file is part of the coreboot project.
-/* This file is part of the coreboot project */
-/* This file is part of the coreboot project. */
-;## This file is part of the coreboot project.
-# This file is part of the coreboot project. It originated in the
- * This file is part of the coreinfo project.
-## This file is part of the coreinfo project.
- * This file is part of the depthcharge project.
-/* This file is part of the depthcharge project. */
-/* This file is part of the ectool project. */
- * This file is part of the GNU C Library.
- * This file is part of the libpayload project.
-## This file is part of the libpayload project.
-/* This file is part of the Linux kernel. */
-## This file is part of the superiotool project.
-/* This file is part of the superiotool project */
-/* This file is part of uio_usbdebug */

Change-Id: I82d872b3b337388c93d5f5bf704e9ee9e53ab3a9
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/41194
Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2020-05-11 17:11:40 +00:00
Jan Dabros b0800d3e41 tests: Add proper license headers
Signed-off-by: Jan Dabros <jsd@semihalf.com>
Change-Id: Id8ca7c53122632c674e6bf952046ea22c0408e55
Reviewed-on: https://review.coreboot.org/c/coreboot/+/41088
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
2020-05-08 15:18:47 +00:00
Jan Dabros 2d0ee36913 tests: Add lib/string-test test case
Show a basic example of how unit testing can be applied for the coreboot
project. Add a test harness for lib/string.c module.

TEST=Install cmocka via appropriate command:
sudo apt-get install -y libcmocka-dev
sudo emerge dev-util/cmocka
yum install libcmocka-devel
* Build and run unit tests via `make unit-tests`
* Check the output to see that tests passed.

Signed-off-by: Jan Dabros <jsd@semihalf.com>
Change-Id: Ibf5554d1e99a393721a66bdd35af0122c2e412c4
Reviewed-on: https://review.coreboot.org/c/coreboot/+/40538
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
2020-05-01 06:33:38 +00:00