[PATCH v5 5/6] test: log: test syslog logging driver

Simon Glass sjg at chromium.org
Fri Feb 28 00:40:40 CET 2020


On Wed, 26 Feb 2020 at 12:48, Heinrich Schuchardt <xypron.glpk at gmx.de> wrote:
>
> Provide unit tests for the syslog logging driver.
>
> Signed-off-by: Heinrich Schuchardt <xypron.glpk at gmx.de>
> ---
> v5:
>         no change
> v4:
>         provide more comments
>         move uts and expected to a common structure
>         expect 'uboot:' not 'uboot[1]:' in syslog message
> v3:
>         new patch
> ---
>  test/log/Makefile      |   4 +
>  test/log/syslog_test.c | 280 +++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 284 insertions(+)
>  create mode 100644 test/log/syslog_test.c

Reviewed-by: Simon Glass <sjg at chromium.org>


See below

>
> diff --git a/test/log/Makefile b/test/log/Makefile
> index 98178f5e2b..4c92550f6e 100644
> --- a/test/log/Makefile
> +++ b/test/log/Makefile
> @@ -8,6 +8,10 @@ ifdef CONFIG_UT_LOG
>
>  obj-y += test-main.o
>
> +ifdef CONFIG_SANDBOX
> +obj-$(CONFIG_LOG_SYSLOG) += syslog_test.o
> +endif
> +
>  ifndef CONFIG_LOG
>  obj-$(CONFIG_CONSOLE_RECORD) += nolog_test.o
>  endif
> diff --git a/test/log/syslog_test.c b/test/log/syslog_test.c
> new file mode 100644
> index 0000000000..6ca5760eac
> --- /dev/null
> +++ b/test/log/syslog_test.c
> @@ -0,0 +1,280 @@
> +// SPDX-License-Identifier: GPL-2.0+
> +/*
> + * Copyright (c) 2020, Heinrich Schuchardt <xypron.glpk at gmx.de>
> + *
> + * Logging function tests for CONFIG_LOG_SYSLOG=y.
> + *
> + * Invoke the test with: ./u-boot -d arch/sandbox/dts/test.dtb
> + */
> +
> +/* Override CONFIG_LOG_MAX_LEVEL */
> +#define LOG_DEBUG
> +
> +#include <common.h>
> +#include <dm/device.h>

That should be at the end


> +#include <hexdump.h>
> +#include <test/log.h>
> +#include <test/test.h>
> +#include <test/suites.h>
> +#include <test/ut.h>
> +#include <asm/eth.h>

test/ comes after asm/


More information about the U-Boot mailing list