summaryrefslogtreecommitdiffhomepage
path: root/systemtest/config/unix.exp
blob: 1bd9310bbdcd4c30cd5f0a800056e7345c077da0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
proc runtest_exit_code { test_name command_line exit_code } {

  exec ./mcc $command_line.cpp

  spawn $command_line
  
  expect eof
 
  exec rm $command_line
 
  lassign [wait] pid spawnid os_error_flag value
  
  if {$os_error_flag == 0} {
    if {$value == $exit_code} {
      pass "$test_name: Returned expected value $value"
    } else {
      fail "$test_name: Returned bad value $value, expected: $exit_code"
    }
  } else {
    fail "$test_name: errno: $value"
  }

}