1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-04-28 23:43:42 +02:00
flashrom/tests/meson.build
Edward O'Callaghan 46f2d4e488 tests/: Add CMocka unit-test infrastructure
This adds the CMocka unit-testing infrastructure into
the meson build system which we will latter follow up
with unit-tests for flashrom's core logic.

BUG=b:157280555
BRANCH=none
TEST=builds

Change-Id: I66665f56627b3d99049176bfbebbd771b080370a
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/41622
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2020-06-16 02:22:41 +00:00

29 lines
606 B
Meson

root_includes = include_directories('../subprojects')
srcs = [
'tests.c',
]
mocks = [
'-Wl,--wrap=physunmap',
'-Wl,--wrap=physmap',
'-Wl,--gc-sections',
]
flashrom_tests = executable('flashrom_unit_tests',
srcs,
include_directories : root_includes,
c_args : [
cargs,
'-ffunction-sections',
'-fdata-sections',
# '-DSTANDALONE',
'-DCONFIG_DEFAULT_PROGRAMMER=PROGRAMMER_DUMMY',
'-DCONFIG_DEFAULT_PROGRAMMER_ARGS=""',
],
export_dynamic : true,
link_args : mocks,
dependencies : [cmocka_dep, flashrom_test_dep],
)
test('cmocka test flashrom', flashrom_tests)