1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (c) 2021, Heinrich Schuchardt <xypron.glpk@gmx.de>
5 * Test continuation of log messages using pr_cont().
11 #include <test/test.h>
12 #include <test/suites.h>
14 #include <asm/global_data.h>
15 #include <linux/printk.h>
19 #undef CONFIG_LOGLEVEL
20 #define CONFIG_LOGLEVEL 4
22 DECLARE_GLOBAL_DATA_PTR;
24 static int log_test_pr_cont(struct unit_test_state *uts)
29 log_fmt = gd->log_fmt;
30 log_level = gd->default_log_level;
32 /* Write two messages, the second continuing the first */
33 gd->log_fmt = BIT(LOGF_MSG);
34 gd->default_log_level = LOGL_INFO;
35 console_record_reset_enable();
38 gd->default_log_level = log_level;
39 gd->log_fmt = log_fmt;
40 gd->flags &= ~GD_FLG_RECORD;
41 ut_assertok(ut_check_console_line(uts, "ea1 cc2"));
42 ut_assertok(ut_check_console_end(uts));
46 LOG_TEST(log_test_pr_cont);