diff options
author | Jacob Bachmeyer <jcb62281@gmail.com> | 2018-12-07 12:14:58 +1100 |
---|---|---|
committer | Ben Elliston <bje@gnu.org> | 2018-12-07 12:14:58 +1100 |
commit | 2403990058228c54f6bcd21a9e4a7fb32fed944a (patch) | |
tree | c402e715e7f175b43c8036ae6d0d554fa9448a67 /testsuite | |
parent | 77fe62fe788ef68605d7fc61ae1da9d1c98a2bec (diff) | |
download | dejagnu-2403990058228c54f6bcd21a9e4a7fb32fed944a.zip dejagnu-2403990058228c54f6bcd21a9e4a7fb32fed944a.tar.gz dejagnu-2403990058228c54f6bcd21a9e4a7fb32fed944a.tar.bz2 |
* testsuite/runtest.all/default_procs.tcl: Whitespace clean up.
(lib_pat_test): Handle an argument list instead of only a single
argument for the procedure under test.
(lib_ret_test): Likewise.
* testsuite/runtest.all/utils.test: Whitespace clean up. Adjust
to pass argument lists for improved lib_pat_test.
* testsuite/runtest.all/clone_output.test: Likewise.
Signed-off-by: Ben Elliston <bje@gnu.org>
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/runtest.all/default_procs.tcl | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/testsuite/runtest.all/default_procs.tcl b/testsuite/runtest.all/default_procs.tcl index d98cc21..c5e4099 100644 --- a/testsuite/runtest.all/default_procs.tcl +++ b/testsuite/runtest.all/default_procs.tcl @@ -20,13 +20,10 @@ proc lib_pat_test { cmd arglist pattern } { # this tests a proc for a returned value proc lib_ret_test { cmd arglist val } { catch { eval [list $cmd] $arglist } result -# catch "set result [$cmd $arg]" output -# set result "$cmd [eval $arg] puts "CMD(lib_ret_test) was: $cmd $arglist" puts "RESULT(lib_ret_test) was: $result" -# puts "OUTPUT(lib_ret_test) was: $output" - if { $result == $val } { + if { $result eq $val } { return 1 } else { return 0 @@ -39,20 +36,20 @@ proc lib_ret_test { cmd arglist val } { # test proc is something like lib_pat_test or lib_ret_test. # proc run_tests { tests } { - foreach i "$tests" { - set result [ [lindex $i 0] "[lindex $i 1]" "[lindex $i 2]" "[lindex $i 3]" ] + foreach test $tests { + set result [eval [lrange $test 0 3]] switch -- $result { "-1" { - puts "ERRORED: [lindex $i 4]" + puts "ERRORED: [lindex $test 4]" } "1" { - puts "PASSED: [lindex $i 4]" + puts "PASSED: [lindex $test 4]" } "0" { - puts "FAILED: [lindex $i 4]" + puts "FAILED: [lindex $test 4]" } default { - puts "BAD VALUE: [lindex $i 4]" + puts "BAD VALUE: [lindex $test 4]" } } } @@ -90,5 +87,5 @@ proc unsupported { msg } { puts "NOTSUPPORTED: $msg" } proc verbose { args } { - puts "[lindex $args 0]" + puts [lindex $args 0] } |