diff options
author | Dmitry Bogatov <KAction@debian.org> | 2019-05-14 11:56:46 +0000 |
---|---|---|
committer | Dmitry Bogatov <KAction@debian.org> | 2019-05-14 11:56:46 +0000 |
commit | ff2177c68252c80e75c2e0fbc4d40e8193d4cb36 (patch) | |
tree | fe5c4e7b5e8d8f9081c7438ee4c0e03415c6c14d /t | |
parent | 365f18bb70df268de5933176e55f4315295b62c7 (diff) |
Create package for test-related code.
Diffstat (limited to 't')
-rw-r--r-- | t/924903.t | 25 |
1 files changed, 1 insertions, 24 deletions
@@ -2,31 +2,8 @@ | |||
2 | use strict; | 2 | use strict; |
3 | use warnings; | 3 | use warnings; |
4 | use Test::More tests => 3; | 4 | use Test::More tests => 3; |
5 | use File::Path qw(remove_tree); | ||
6 | use File::Copy::Recursive qw(dircopy); | ||
7 | use File::stat; | 5 | use File::stat; |
8 | use Cwd; | 6 | use T; |
9 | |||
10 | my $root = Cwd::cwd; | ||
11 | $ENV{PATH} = "$root:$ENV{PATH}"; | ||
12 | $ENV{DH_AUTOSCRIPTDIR} = $root; | ||
13 | |||
14 | sub prepare_source_package { | ||
15 | die '$0 does not match expected format' | ||
16 | unless ($0 =~ m#t/([0-9]+)\.t#); | ||
17 | my $number = $1; | ||
18 | my $srcdir = (-d "t/base/${number}") ? "t/base/${number}" : "t/base/default"; | ||
19 | my $testdir = "t/${number}"; | ||
20 | dircopy($srcdir, $testdir); | ||
21 | chdir($testdir); | ||
22 | return $testdir; | ||
23 | } | ||
24 | |||
25 | sub system_ok { | ||
26 | ok(system(@_) == 0, "external command @_"); | ||
27 | } | ||
28 | |||
29 | prepare_source_package(); | ||
30 | 7 | ||
31 | system_ok('dh_runit', 'debian/test.runscript', 'name=test'); | 8 | system_ok('dh_runit', 'debian/test.runscript', 'name=test'); |
32 | my $path = 'debian/dh-runit-test/var/lib/runit/supervise/test'; | 9 | my $path = 'debian/dh-runit-test/var/lib/runit/supervise/test'; |