| 384 | } |
| 385 | |
| 386 | int GetExitCode() |
| 387 | { |
| 388 | // Unconsumed commands remaining in the input file is also an error condition. |
| 389 | if( !GetError() && !PeekTokens().empty() ) { |
| 390 | NextIn(); |
| 391 | SetError(); |
| 392 | } |
| 393 | if ( GetError() ) { |
| 394 | // Return nonzero |
| 395 | // Returning the (1-based) line number at which the script failed is a |
| 396 | // simple way to communicate that information to the test driver script. |
| 397 | return sLineNumber ? sLineNumber : -1; |
| 398 | } |
| 399 | |
| 400 | // Return zero to mean all is well, the convention for command-line tools |
| 401 | return 0; |
| 402 | } |
| 403 | |
| 404 | } |