Christian Franke | 8f399b0 | 2013-09-30 12:27:50 +0000 | [diff] [blame] | 1 | set timeout 30 |
| 2 | set test_name "testcommands" |
| 3 | |
David Lamparter | e712d0e | 2014-04-01 19:34:55 +0200 | [diff] [blame] | 4 | if {![info exists env(QUAGGA_TEST_COMMANDS)]} { |
| 5 | # sadly, the test randomly fails when configure parameters differ from |
| 6 | # what was used to create testcommands.refout. this can be fixed by |
| 7 | # shipping a matching vtysh_cmd.c, which we'll add after 0.99.23 |
| 8 | unresolved "$test_name" |
| 9 | exit 0 |
| 10 | } |
| 11 | |
| 12 | spawn sh -c "./testcommands -e 0 < $env(srcdir)/testcommands.in | diff -au - $env(srcdir)/testcommands.refout" |
Christian Franke | 8f399b0 | 2013-09-30 12:27:50 +0000 | [diff] [blame] | 13 | |
| 14 | expect { |
| 15 | eof { |
| 16 | } |
| 17 | timeout { |
| 18 | exp_close |
| 19 | fail "$test_name: timeout" |
| 20 | } |
| 21 | } |
| 22 | |
| 23 | catch wait result |
| 24 | set os_error [lindex $result 2] |
| 25 | set exit_status [lindex $result 3] |
| 26 | |
| 27 | if { $os_error == 0 && $exit_status == 0 } { |
| 28 | pass "$test_name" |
| 29 | } else { |
| 30 | fail "$test_name" |
| 31 | } |