@@ -8,18 +8,46 @@ use Env;
8my $exitstatus = 0;
8my $exitstatus = 0;
9my @idrOpts = ();
9my @idrOpts = ();
12+# Determines how idris was built locally, returning a PATH modifier.
14+# Order of checking is:
11sub sandbox_path {
20sub sandbox_path {
12 my ($test_dir,) = @_;
21 my ($test_dir,) = @_;
13 my $sandbox = "$test_dir/../../.cabal-sandbox/bin";
22 my $sandbox = "$test_dir/../../.cabal-sandbox/bin";
24+ my $stack_bin_path = `stack path --dist-dir`;
25+ $stack_bin_path =~ s/\n//g;
26+ my $stack_work_dir = "$test_dir/../../$stack_bin_path/build/idris";
15 if ( -d $sandbox ) {
28 if ( -d $sandbox ) {
16 my $sandbox_abs = abs_path($sandbox);
30 my $sandbox_abs = abs_path($sandbox);
31+ print "Using Cabal Sandbox\n";
32+ printf("Sandbox located at: %s\n", $sandbox_abs);
17 return "PATH=\"$sandbox_abs:$PATH\"";
33 return "PATH=\"$sandbox_abs:$PATH\"";
35+ } elsif ( -d $stack_work_dir ) {
37+ my $stack_work_abs = abs_path($stack_work_dir);
38+ print "Using Stack Work\n";
39+ printf("Stack work located at: %s\n", $stack_work_abs);
40+ return "PATH=\"$stack_work_abs:$PATH\"";
43+ print "Using Default Cabal.\n";
19 return "";
44 return "";
48+# Run an individual test, and compare expected output with given
49+# output and report results.
23sub runtest {
51sub runtest {
24 my ($test, $update) = @_;
52 my ($test, $update) = @_;
@@ -73,8 +101,13 @@ sub runtest {
73 chdir "..";
101 chdir "..";
104+# Main test running program to sort test input, and execute individual
76my ( @without, @args, @tests, @opts );
108my ( @without, @args, @tests, @opts );
110+# Deal with the Args.
78if ($#ARGV>=0) {
111if ($#ARGV>=0) {
79 my $test = shift @ARGV;
112 my $test = shift @ARGV;
80 if ($test eq "all") {
113 if ($test eq "all") {
@@ -120,6 +153,8 @@ else {
123my $update = 0;
158my $update = 0;
124my $diff = 0;
159my $diff = 0;
125my $show = 0;
160my $show = 0;