# 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
