File: win-exec.t

package info (click to toggle)
librun-parts-perl 0.09-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 196 kB
  • ctags: 20
  • sloc: perl: 409; makefile: 4; sh: 4
file content (42 lines) | stat: -rw-r--r-- 844 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!perl -T

use strict;
use warnings;
use 5.010;

use Test::More;
use Test::Differences;

if ($^O ne 'dos' and $^O ne 'os2' and $^O ne 'MSWin32' ) {
    plan skip_all => 'these tests are irrelevant on non-dos-ish systems';
} else {
    plan tests => 5;
}

delete @ENV{qw{PATH ENV IFS CDPATH BASH_ENV}};

my $d = 't\win-exec-dummy';
my @exe_files = qw[bla.bat foo.bat];

use_ok( 'Run::Parts' );

# Testing the perl backend
run_test_on_rp($d, 'perl');

# Testing the automatically chosen backend
run_test_on_rp($d);

sub run_test_on_rp {
    my ($d, $desc) = @_;
    my $rp = Run::Parts->new($d, $desc);

    $desc ||= 'default';

    ok($rp, 'Run::Parts->new($desc) returned non-nil');

    # Executes executable files
    eq_or_diff(''.$rp->run,
               "foobla\nfoofoo\n",
               "Returns output of ran executables ($desc)");
}