aboutsummaryrefslogtreecommitdiffstats
path: root/tests/tests.c
diff options
context:
space:
mode:
authorEdward O'Callaghan <quasisec@google.com>2020-05-20 20:10:20 +1000
committerEdward O'Callaghan <quasisec@chromium.org>2020-06-16 02:22:41 +0000
commit46f2d4e488db66b37e892b8fa621eeed0fe2f284 (patch)
tree515d9dbe880b4942c33c6e1af3d5ce6d0182af91 /tests/tests.c
parent6f793e4500a04b096676555dced98b207e06eeb7 (diff)
downloadflashrom-46f2d4e488db66b37e892b8fa621eeed0fe2f284.tar.gz
flashrom-46f2d4e488db66b37e892b8fa621eeed0fe2f284.tar.bz2
flashrom-46f2d4e488db66b37e892b8fa621eeed0fe2f284.zip
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>
Diffstat (limited to 'tests/tests.c')
-rw-r--r--tests/tests.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/tests.c b/tests/tests.c
new file mode 100644
index 00000000..32353fa6
--- /dev/null
+++ b/tests/tests.c
@@ -0,0 +1,25 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
+
+#include <include/test.h>
+#include "tests.h"
+
+#include <stdio.h>
+
+/* redefinitions/wrapping */
+void __wrap_physunmap(void *virt_addr, size_t len)
+{
+ fprintf(stderr, "%s\n", __func__);
+}
+void *__wrap_physmap(const char *descr, uintptr_t phys_addr, size_t len)
+{
+ fprintf(stderr, "%s\n", __func__);
+ return NULL;
+}
+
+int main(void)
+{
+ int ret = 0;
+
+ return ret;
+}