Browse Source

Fix handling of lists given as command-line parameters

master
Jacob Bachmeyer 3 years ago
parent
commit
c298959ef9
  1. 13
      ChangeLog
  2. 4
      runtest.exp
  3. 7
      testsuite/runtest.main/options.exp

13
ChangeLog

@ -1,5 +1,18 @@
2023-04-20 Jacob Bachmeyer <jcb@gnu.org>
PR62982
Initial report: Christoph Muellner <christoph.muellner@vrull.eu>
* 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.

4
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
}

7
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" }

Loading…
Cancel
Save