on master help sign in
Make a mechanism for os-dependent output of tests

Fixes interactive007 on Windows.

commita6475a20938ac0848fc3cb05d6ad32417e2c89e1 authorNiklas Larsson <niklas@mm.st> dateFri 3 Apr 2015, 13:45 (12 years ago) parent2e919c8
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;