on master help sign in
Merge pull request #2110 from melted/variable_expectations

Make a mechanism for os-dependent output of tests

commitdbc767bf8dfcb0b398720d49b7c4ad3b9c7dd95f authorDavid Christiansen <david@davidchristiansen.dk> dateThu 9 Apr 2015, 16:20 (12 years ago) parentb8a3f7ea6475a2
2 files changed+9
test/interactive007/expected.msys+1 test/runtest.pl+8
test/interactive007/expected.msysnew file+1
@@ -0,0 +1 @@
1+Idris> *Data\ZZ> *Data\ZZ> *Data\ZZ> *Data\ZZ> Bye bye
test/runtest.pl+8
@@ -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;