From c298959ef991b389b64a825f70094738c6a48780 Mon Sep 17 00:00:00 2001 From: Jacob Bachmeyer Date: Thu, 20 Apr 2023 21:24:32 -0500 Subject: [PATCH] Fix handling of lists given as command-line parameters --- ChangeLog | 13 +++++++++++++ runtest.exp | 4 ++-- testsuite/runtest.main/options.exp | 7 +++++-- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index da26d58..8a012ce 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,18 @@ 2023-04-20 Jacob Bachmeyer + PR62982 + + Initial report: Christoph Muellner + + * runtest.exp (restore_cmd_vars): Fix handling of values + containing whitespace, which are treated as multiple-element + lists and disrupt the eval implied by uplevel here. + + * testsuite/runtest.main/options.exp: Add PR62982 regression test. + Improve tests for --target_board option by checking reported + target list instead of relying on actually running targets for + which no description file exists. + * testsuite/runtest.main/options.exp: Change argument lists for test cases to conventional Tcl list notation using braces. diff --git a/runtest.exp b/runtest.exp index 7c6018f..84c7e28 100644 --- a/runtest.exp +++ b/runtest.exp @@ -1,5 +1,5 @@ # runtest.exp -- Test framework driver -# Copyright (C) 1992-2019, 2020, 2022 Free Software Foundation, Inc. +# Copyright (C) 1992-2019, 2020, 2022, 2023 Free Software Foundation, Inc. # # This file is part of DejaGnu. # @@ -432,7 +432,7 @@ namespace eval ::dejagnu::command_line { variable cmd_var_list foreach {name value} $cmd_var_list { - uplevel 1 set $name $value + uplevel 1 [list set $name $value] } verbose "Variables set by command line arguments restored." 4 } diff --git a/testsuite/runtest.main/options.exp b/testsuite/runtest.main/options.exp index 4154d14..f16a830 100644 --- a/testsuite/runtest.main/options.exp +++ b/testsuite/runtest.main/options.exp @@ -49,8 +49,11 @@ set tests { "Target is m68k-vxworks" "--target option" } { {-v --target_board flash} - "Running target flash" - "--target_board option" } + "target list is flash" + "--target_board option with single target" } + { {-v --target_board {flash/ilp32 flash/ilp48 flash/ilp64}} + "target list is flash/ilp32 flash/ilp48 flash/ilp64" + "--target_board option with multiple targets" } { {-v --host sparc-sun-sunos4.1.9} "Native configuration is sparc-sun-sunos4.1.9" "--host option" } -- 2.11.4.GIT