1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-11-01 19:05:51 +01:00
Files
u-boot-megous/test/cmd/pinmux.c
Simon Glass 725c438c62 test: Rename unit-test flags
The UT_TESTF_ macros read as 'unit test test flags' which is not right.
Rename to UTF ('unit test flags').

This has the benefit of being shorter, which helps keep UNIT_TEST()
declarations on a single line.

Give the enum a name and reference it from the UNIT_TEST() macros while
we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-08-26 18:51:48 -06:00

41 lines
1.1 KiB
C

// SPDX-License-Identifier: GPL-2.0+
/*
* Executes tests for pinmux command
*
* Copyright (C) 2021, STMicroelectronics - All Rights Reserved
*/
#include <command.h>
#include <dm.h>
#include <dm/test.h>
#include <test/test.h>
#include <test/ut.h>
static int dm_test_cmd_pinmux_status_pinname(struct unit_test_state *uts)
{
struct udevice *dev;
ut_assertok(uclass_get_device(UCLASS_LED, 2, &dev));
/* Test that 'pinmux status <pinname>' displays the selected pin. */
console_record_reset();
run_command("pinmux status a5", 0);
ut_assert_nextlinen("a5 : gpio output .");
ut_assert_console_end();
console_record_reset();
run_command("pinmux status P7", 0);
ut_assert_nextlinen("P7 : GPIO2 bias-pull-down input-enable.");
ut_assert_console_end();
console_record_reset();
run_command("pinmux status P9", 0);
ut_assert_nextlinen("single-pinctrl pinctrl-single-no-width: missing register width");
ut_assert_nextlinen("P9 not found");
ut_assert_console_end();
return 0;
}
DM_TEST(dm_test_cmd_pinmux_status_pinname, UTF_SCAN_PDATA | UTF_SCAN_FDT);