Commit 18e558e7216a50e153348c99e088f83d2901fa7b
1 parent
e35e4099
Update qtest version to 1.6
Showing
2 changed files
with
15 additions
and
4 deletions
qtest/bin/qtest-driver
qtest/module/TestDriver.pm
| ... | ... | @@ -711,9 +711,20 @@ sub runtest |
| 711 | 711 | elsif (defined $in_file) |
| 712 | 712 | { |
| 713 | 713 | &QTC::TC("testdriver", "TestDriver input file"); |
| 714 | - open($in, '<', $in_file) or | |
| 715 | - croak +(+__PACKAGE__, | |
| 716 | - "->runtest: unable to read from input file $in_file: $!\n"); | |
| 714 | + if (! open($in, '<', $in_file)) | |
| 715 | + { | |
| 716 | + # If the input file is not found, generate a string to use | |
| 717 | + # as input, and make the string different each run to | |
| 718 | + # prevent sloppy commiting of the string as the expected | |
| 719 | + # output. This prevents complete failure in cases when the | |
| 720 | + # input file is not found, such as when one test's input | |
| 721 | + # file is generated by something that may have failed | |
| 722 | + # earlier. | |
| 723 | + my $not_found = "qtest, pid=$$: input file $in_file not found\n"; | |
| 724 | + open($in, '<', \$not_found) or | |
| 725 | + croak +(+__PACKAGE__, | |
| 726 | + "->runtest: unable to read from input file $in_file: $!\n"); | |
| 727 | + } | |
| 717 | 728 | } |
| 718 | 729 | elsif (defined $in_command) |
| 719 | 730 | { | ... | ... |