Anna Karaś has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/43285 )
Change subject: tests: Move the console stubs to a dedicated directory ......................................................................
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 --- M tests/lib/Makefile.inc M tests/lib/b64_decode-test.c A tests/stubs/console.c 3 files changed, 14 insertions(+), 6 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/85/43285/1
diff --git a/tests/lib/Makefile.inc b/tests/lib/Makefile.inc index 594c68e..b66d386 100644 --- a/tests/lib/Makefile.inc +++ b/tests/lib/Makefile.inc @@ -8,6 +8,7 @@ string-test-srcs += src/lib/string.c
b64_decode-test-srcs += tests/lib/b64_decode-test.c +b64_decode-test-srcs += tests/stubs/console.c b64_decode-test-srcs += src/lib/b64_decode.c
hexstrtobin-test-srcs += tests/lib/hexstrtobin-test.c diff --git a/tests/lib/b64_decode-test.c b/tests/lib/b64_decode-test.c index 452c67f..e6bbca5 100644 --- a/tests/lib/b64_decode-test.c +++ b/tests/lib/b64_decode-test.c @@ -24,12 +24,6 @@ "SGVsbG-8=" };
-/* Provide necessary definition in order to satisfy dependencies. */ -int do_printk(int msg_level, const char *fmt, ...) -{ - return 0; -} - static void test_b64_decode(void **state) { uint8_t *decoded; diff --git a/tests/stubs/console.c b/tests/stubs/console.c new file mode 100644 index 0000000..b6a7583 --- /dev/null +++ b/tests/stubs/console.c @@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include <console/console.h> + +int do_printk(int msg_level, const char *fmt, ...) +{ + return 0; +} + +int do_vprintk(int msg_level, const char *fmt, va_list args) +{ + return 0; +}
Paul Fagerburg has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/43285 )
Change subject: tests: Move the console stubs to a dedicated directory ......................................................................
Patch Set 1: Code-Review+2
Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/43285 )
Change subject: tests: Move the console stubs to a dedicated directory ......................................................................
Patch Set 1: Code-Review+2
Thanks!
Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/43285 )
Change subject: tests: Move the console stubs to a dedicated directory ......................................................................
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 --- M tests/lib/Makefile.inc M tests/lib/b64_decode-test.c A tests/stubs/console.c 3 files changed, 14 insertions(+), 6 deletions(-)
Approvals: build bot (Jenkins): Verified Julius Werner: Looks good to me, approved Paul Fagerburg: Looks good to me, approved
diff --git a/tests/lib/Makefile.inc b/tests/lib/Makefile.inc index 594c68e..b66d386 100644 --- a/tests/lib/Makefile.inc +++ b/tests/lib/Makefile.inc @@ -8,6 +8,7 @@ string-test-srcs += src/lib/string.c
b64_decode-test-srcs += tests/lib/b64_decode-test.c +b64_decode-test-srcs += tests/stubs/console.c b64_decode-test-srcs += src/lib/b64_decode.c
hexstrtobin-test-srcs += tests/lib/hexstrtobin-test.c diff --git a/tests/lib/b64_decode-test.c b/tests/lib/b64_decode-test.c index 452c67f..e6bbca5 100644 --- a/tests/lib/b64_decode-test.c +++ b/tests/lib/b64_decode-test.c @@ -24,12 +24,6 @@ "SGVsbG-8=" };
-/* Provide necessary definition in order to satisfy dependencies. */ -int do_printk(int msg_level, const char *fmt, ...) -{ - return 0; -} - static void test_b64_decode(void **state) { uint8_t *decoded; diff --git a/tests/stubs/console.c b/tests/stubs/console.c new file mode 100644 index 0000000..b6a7583 --- /dev/null +++ b/tests/stubs/console.c @@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include <console/console.h> + +int do_printk(int msg_level, const char *fmt, ...) +{ + return 0; +} + +int do_vprintk(int msg_level, const char *fmt, va_list args) +{ + return 0; +}