Commit Graph

9 Commits

Author SHA1 Message Date
Jakub Czapiga d190e0fa96 tests/Makefile.common: Remove unnecessary dependency to kconfig/conf
Utility will be built while executing kconfig targets so it is not
necessary to keep hard dependency on kconfig here.

Signed-off-by: Jakub Czapiga <jacz@semihalf.com>
Change-Id: I578f3e1d9de63e91ded44746539265bcd55bf579
Reviewed-on: https://review.coreboot.org/c/coreboot/+/70298
Reviewed-by: Jan Dabros <jsd@semihalf.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2022-12-17 20:32:12 +00:00
Jakub Czapiga ab0686109e tests/Makefile.common: Allow to override tests defconfig
Some tools based on test framework might require defconfig other
than one set in tests framework.

Signed-off-by: Jakub Czapiga <jacz@semihalf.com>
Change-Id: If53b9a54ef7389dd979dfe772e6946439f7d6a62
Reviewed-on: https://review.coreboot.org/c/coreboot/+/70109
Reviewed-by: Jan Dabros <jsd@semihalf.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2022-12-17 20:31:38 +00:00
Jakub Czapiga 3088e43a5a tests/Makefile.common: Describe available test attributes
Signed-off-by: Jakub Czapiga <jacz@semihalf.com>
Change-Id: I8ce702b4be254e206e2018deabde985b56cc6cd3
Reviewed-on: https://review.coreboot.org/c/coreboot/+/70475
Reviewed-by: Jan Dabros <jsd@semihalf.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2022-12-17 20:30:45 +00:00
Jakub Czapiga e744ba643d tests: Support linking with system libc
This patch allows for linking selected files with system libc. This
allows for creating libraries interacting with filesystem, standard I/O
and other parts of system. Until now it was only possible using CMocka
proxy functions or functions not masked by code under test.

Signed-off-by: Jakub Czapiga <jacz@semihalf.com>
Change-Id: I652362ba61a25e974d706357fc36479ccee763e4
Reviewed-on: https://review.coreboot.org/c/coreboot/+/70108
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Jan Dabros <jsd@semihalf.com>
2022-12-17 20:30:12 +00:00
Jakub Czapiga 3c8a3d1295 tests/Makefile.common: Allow to disable test framework with parameter
Test framework can be used as a base for other test-like utilities - for
example look at screenshoot utility in depthcharge. Sometimes CMocka is
not required and even makes things problematic. Thanks to this patch one
can set -no_test_framework parameter to instruct framework not to
include and link selected test against CMocka library.

Signed-off-by: Jakub Czapiga <jacz@semihalf.com>
Change-Id: I01dc7c6c50e6ae2f7f71bd6752c2d5f2cc7c3cdc
Reviewed-on: https://review.coreboot.org/c/coreboot/+/70107
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Jan Dabros <jsd@semihalf.com>
2022-12-14 13:37:39 +00:00
Jakub Czapiga a0e36d8cba tests: Add support for tests build failures detection
This patch introduces new target: junit.xml-unit-tests, which builds and
runs unit-tests. It also creates build log containing build logs. This
feature allows for one to see build failures in Jenkins dashboard.

Signed-off-by: Jakub Czapiga <jacz@semihalf.com>
Change-Id: I94184379dcc2ac10f1a47f4a9d205cacbeb640fe
Reviewed-on: https://review.coreboot.org/c/coreboot/+/67372
Reviewed-by: Julius Werner <jwerner@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2022-09-21 14:06:42 +00:00
Jakub Czapiga 90072900b3 tests: Disable unnecessary warnings
Unit-tests had more strict warning setings than main build. Sometimes it
can cause unit-tests builds to fail even if code compiles correctly when
building normal coreboot image.

Signed-off-by: Jakub Czapiga <jacz@semihalf.com>
Change-Id: Ia219ccc8631b069436497eb45a1552a0910f7aa1
Reviewed-on: https://review.coreboot.org/c/coreboot/+/67453
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Georgi <patrick@coreboot.org>
2022-09-09 19:07:44 +00:00
Bill XIE 348909a574 tests: Adjust the order of header files to include
Consistent with real build process, it retains more potential to
detect the build environment.

Signed-off-by: Bill XIE <persmule@hardenedlinux.org>
Change-Id: I46f2fe04bf1b8c1ca6476f05555114fa1ef2a96e
Reviewed-on: https://review.coreboot.org/c/coreboot/+/65728
Reviewed-by: Elyes Haouas <ehaouas@noos.fr>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2022-07-14 23:08:24 +00:00
Jakub Czapiga 9ebc6c1e26 tests: Split Makefile to allow for making host-side test tools
This patch is based on similar changes [1] done in Depthcharge projects,
which aimed to provide unified way to build host-side programs for
testing internal code. New test tools might benefit from it by having
same base code as unit-tests.

[1] https://crrev.com/c/3412108

TEST=make unit-tests
TEST=COV=1 make unit-tests coverage-report

Signed-off-by: Jakub Czapiga <jacz@semihalf.com>
Change-Id: Iac4517ab6146fa3f2d2b7a20df54601ab2d04c3d
Reviewed-on: https://review.coreboot.org/c/coreboot/+/63637
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
2022-04-19 13:00:56 +00:00