summaryrefslogtreecommitdiff
path: root/tests/Makefile.common
AgeCommit message (Collapse)Author
2024-05-21tests/lib: Factor out file related functionsMaximilian Brune
Signed-off-by: Maximilian Brune <maximilian.brune@9elements.com> Change-Id: I5c22913b35848c5ea32d6805ea081abefd3380bf Reviewed-on: https://review.coreboot.org/c/coreboot/+/82237 Reviewed-by: Julius Werner <jwerner@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Jakub Czapiga <czapiga@google.com>
2024-03-15treewide: Move stdlib.h to commonlibMaximilian Brune
This patch moves commonlib/stdlib.h -> commonlib/bsd/stdlib.h, since all code is BSD licensed anyway. It also moves some code from libpayloads stdlib.h to commonlib/bsd/stdlib.h so that it can be shared with coreboot. This is useful for a subsequent commit that adds devicetree.c into commonlib. Also we don't support DMA on arm platforms in coreboot (only libpayload) therefore `dma_malloc()` has been removed and `dma_coherent()` has been moved to architecture specific functions. Any architecture that tries to use `dma_coherent()` now will get a compile time error. In order to not break current platforms like mb/google/herobrine which make use of the commonlib/storage/sdhci.c controller which in turn uses `dma_coherent` a stub has been added to arch/arm64/dma.c. Signed-off-by: Maximilian Brune <maximilian.brune@9elements.com> Change-Id: I3a7ab0d1ddcc7ce9af121a61b4d4eafc9e563a8a Reviewed-on: https://review.coreboot.org/c/coreboot/+/77969 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
2024-03-09tests: Add `DEBUG` make commandline option to generate debug symbolsJulius Werner
Sometimes when a test doesn't work it's convenient to run it through GDB. This patch adds a variable you can set on the make commandline to conveniently enable all the compiler flags needed to make that work. Change-Id: I3ac80ad095e0b72cc3176cbf915d1f390cd01558 Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/81112 Reviewed-by: Jakub Czapiga <czapiga@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Yu-Ping Wu <yupingso@google.com>
2024-01-26tests: Rename Makefiles from .inc to .mkMartin Roth
The .inc suffix is confusing to various tools as it's not specific to Makefiles. This means that editors don't recognize the files, and don't open them with highlighting and any other specific editor functionality. This issue is also seen in the release notes generation script where Makefiles get renamed before running cloc. Signed-off-by: Martin Roth <gaumless@gmail.com> Change-Id: Id09eafd293a54198aab87281f529749325df8b07 Reviewed-on: https://review.coreboot.org/c/coreboot/+/80122 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Felix Held <felix-coreboot@felixheld.de> Reviewed-by: Felix Singer <service+coreboot-gerrit@felixsinger.de>
2023-11-16Revert "tests: Allow specifying vboot source directory"Felix Singer
This reverts commit 7713a2f295d9ed9a7023a78e085ce190ee1203fe. Reason for revert: breaks main branch Change-Id: I2749bea9369c222e510b838e278c7797d5dce56e Signed-off-by: Felix Singer <felixsinger@posteo.net> Reviewed-on: https://review.coreboot.org/c/coreboot/+/78852 Reviewed-by: Martin L Roth <gaumless@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Felix Held <felix-coreboot@felixheld.de> Reviewed-by: Patrick Georgi <patrick@coreboot.org>
2023-11-16tests: Allow specifying vboot source directoryroccochen@chromium.com
Respect VBOOT_SOURCE while including generic headers. BUG=none TEST=make clean-unit-tests && VBOOT_SOURCE=/path/to/vboot_reference/ make unit-tests -j TEST=make clean-unit-tests && make unit-tests -j BRANCH=none Change-Id: Id3bb3726c91167d2dd648d748763a3948787f28d Signed-off-by: roccochen@chromium.com <roccochen@chromium.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/78849 Reviewed-by: Yu-Ping Wu <yupingso@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2022-12-17tests/Makefile.common: Remove unnecessary dependency to kconfig/confJakub Czapiga
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-17tests/Makefile.common: Allow to override tests defconfigJakub Czapiga
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-17tests/Makefile.common: Describe available test attributesJakub Czapiga
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-17tests: Support linking with system libcJakub Czapiga
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-14tests/Makefile.common: Allow to disable test framework with parameterJakub Czapiga
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-09-21tests: Add support for tests build failures detectionJakub Czapiga
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-09tests: Disable unnecessary warningsJakub Czapiga
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-07-14tests: Adjust the order of header files to includeBill XIE
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-04-19tests: Split Makefile to allow for making host-side test toolsJakub Czapiga
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>