@@ -30,6 +30,14 @@ sub runtest {
3030 my $got = `$sandbox ./run @idrOpts`;
3131 my $exp = `cat expected`;
3232
33+ # Allow for variant expected output for tests by overriding expected
34+ # when there is an expected.<os> file in the test.
35+ # This should be the exception but there are sometimes valid reasons
36+ # for os-dependent output.
37+ # The endings are msys for windows, darwin for osx and linux for linux
38+ if ( -e "expected.$^O") {
39+ $exp = `cat expected.$^O`;
40+ }
3341 open my $out, '>', 'output';
3442 print $out $got;
3543 close $out;