mirror of
https://git.code.sf.net/p/openocd/code
synced 2025-05-10 01:15:12 +00:00
Introduce basic testing of error-handling in target configuration related commands. The tests can be run via `make check` when JTAG `dummy` adapter is enabled. Change-Id: Id0f382046dd70007d8e696d82d2396a7ccab7a33 Signed-off-by: Evgeniy Naydanov <evgeniy.naydanov@syntacore.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8644 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
32 lines
835 B
INI
32 lines
835 B
INI
# SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
namespace import testing_helpers::*
|
|
namespace import configure_testing::*
|
|
|
|
adapter driver dummy
|
|
jtag newtap tap cpu -irlen 5
|
|
|
|
{*}[target_create_first_args] {*}[simple_configure_options]
|
|
|
|
set target_name [lindex [target names] 0]
|
|
|
|
check_matches testee {$target_name cget -type}
|
|
|
|
foreach {opt arg} [simple_configure_options] {
|
|
check_syntax_err {$target_name cget $opt extra_arg}
|
|
check_matches [dict get [simple_configure_options] $opt] \
|
|
{$target_name cget $opt}
|
|
}
|
|
|
|
check_error_matches .*-event.* {$target_name cget -event}
|
|
$target_name cget -event examine-start
|
|
check_syntax_err {$target_name cget -event examine-start extra_arg}
|
|
|
|
check_syntax_err {$target_name configure}
|
|
|
|
foreach {opt arg} [simple_configure_options] {
|
|
$target_name configure $opt [$target_name cget $opt]
|
|
}
|
|
|
|
shutdown
|