Set initial commit timestamp to be constant.
[git-darcs-import.git] / tests / external.pl
blobc033dabf54865d8838993631b7fae417693d227a
1 #!/usr/bin/env perl
3 # Some tests for launching external commands
5 use lib 'lib/perl';
6 use Test::More 'no_plan';
7 use Test::Darcs;
8 use Shell::Command;
9 use File::Slurp;
10 use strict;
12 init_tmp_repo();
14 my $touch_fakessh='touch-fakessh';
15 $touch_fakessh.='.bat' if ($^O =~ /(msys|win32)/i);
17 cleanup 'fakessh';
18 cleanup 'touch-fakessh';
19 ###
21 # make our ssh command one word only
22 write_file($touch_fakessh,'echo hello > fakessh');
23 `chmod u+x $touch_fakessh`;
24 # add our fake ssh command to the environment
25 $ENV{DARCS_SSH}="./$touch_fakessh";
26 $ENV{DARCS_SCP}="./$touch_fakessh";
27 $ENV{DARCS_SFTP}="./$touch_fakessh";
28 # first test the DARCS_SSH environment variable
29 darcs(qw(get foo.bar:baz));
30 ok(-e 'fakessh');
31 cleanup 'fakessh';
32 # now make sure that we don't launch ssh for nothing
33 cleanup 'temp2';
34 darcs(qw(get temp2));
35 ok(! -e 'fakessh');
36 darcs(qw(get http://foo.bar:baz));
37 ok(! -e 'fakessh');