13 my $sandbox = abs_path("$test_dir/../../.cabal-sandbox/bin");
16 return "PATH=\"$sandbox:$PATH\"";
23 my ($test, $update) = @_;
25 my $sandbox = sandbox_path($test);
29 print "Running $test...\n";
30 my $got = `$sandbox ./run @idrOpts`;
31 my $exp = `cat expected`;
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`;
41 open my $out, '>', 'output';
45 # $ok = system("diff output expected &> /dev/null");
46 # Mangle newlines in $got and $exp
50 # Normalize paths in $got and $exp, so the expected outcomes don't
51 # change between platforms
52 while($got =~ /(^|.*?\n)(.*?)\\(.*?):(\d+):(.*)/ms) {
53 $got = "$1$2/$3:$4:$5";
55 while($exp =~ /(^|.*?\n)(.*?)\\(.*?):(\d+):(.*)/ms) {
56 $exp = "$1$2/$3:$4:$5";
60 print "Ran $test...success\n";
65 print "Ran $test...FAILURE\n";
66 system "diff output expected";
68 system("cp output expected");
69 print "Ran $test...UPDATED\n";
75my ( @without, @args, @tests, @opts );
78 my $test = shift @ARGV;
81 my @list = readdir $dir;
82 foreach my $file (@list) {
83 if ($file =~ /[0-9][0-9][0-9]$/) {
89 } elsif ($test eq "without") {
91 foreach my $file (@args) {
92 last if ($file =~ /--/);
93 push @without, shift @ARGV;
97 my @list = readdir $dir;
98 foreach my $file (@list) {
99 if ($file =~ /[0-9][0-9][0-9]$/) {
100 if (!(grep ($_ eq $file, @without))) {
104 print "Omitting $file\n";
108 @tests = sort @tests;
111 if ($test =~ /[0-9][0-9][0-9]$/) {
118 print "Give a test name, or 'all' to run all.\n";
127while (my $opt = shift @opts) {
128 if ($opt eq "-u") { $update = 1; }
129 elsif ($opt eq "-d") { $diff = 1; }
130 elsif ($opt eq "-s") { $show = 1; }
131 else { push(@idrOpts, $opt); }
134my $idris = $ENV{IDRIS};
135my $path = $ENV{PATH};
136$ENV{PATH} = cwd() . "/" . $idris . ":" . $path;
138foreach my $test (@tests) {
139 if ($diff == 0 && $show == 0) {
140 runtest($test,$update);
149 print "Differences in $test:\n";
150 my $ok = system "diff output expected";
152 print "No differences found.\n";
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list