3 # Run each of the shell tests, capturing the output, and reporting passed
8 # Place to put test output to avoid cluttering test/
9 mkdir 'test_output', 0750;
11 # Override the users default .darcs settings
14 system 'echo ALL --ignore-times >> .darcs/defaults';
15 # Used for finding darcs, but may not be defined by the shell
18 # Put the right darcs first in PATH
19 my $darcspath="$ENV{HOME}/..";
21 # User has asked for a particular darcs...
22 my $actualdarcs=`which $ENV{DARCS}`;
23 my $darcspath=`dirname "$actualdarcs"`;
25 $ENV{PATH
} = "$darcspath:$ENV{PATH}";
27 # Some environment variables can act as defaults that we don't want
28 $ENV{EMAIL
} = $ENV{DARCS_EMAIL
} = 'tester';
30 # These two environment variables will turn off darcs' "Christmas mode".
31 # It will make the tests run a tad faster, and make darcs' output
32 # independent of the testing systems locale and environment.
33 $ENV{DARCS_DONT_COLOR
} = 1;
34 $ENV{DARCS_DONT_ESCAPE_ANYTHING
} = 1;
39 for my $test (@ARGV) {
40 my $test_out = "test_output/$test.out";
42 printf "Running %-40s", "$test ...";
44 my $output = `bash $test 2>&1`;
51 push @Failures, $test;
54 print "Output from failed $test:\n$output";
59 print "All tests successful!\n";
62 print "TESTS FAILED!\n";
63 print "\t$_\n" for @Failures;
66 # Exit with non-zero if anything failed.