aboutsummaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorPer Øyvind Karlsen <peroyvind@mandriva.org>2009-07-22 18:21:30 +0000
committerPer Øyvind Karlsen <peroyvind@mandriva.org>2009-07-22 18:21:30 +0000
commitefe14df5eedcd0c1cbab65142c7b982b41e88341 (patch)
tree76c1ebfa193700a3f0ca7a64f78c2ee63fe64a89 /t
parenta4b836dfe43cf1a498e93094d54d498a55142fef (diff)
downloadperl-URPM-efe14df5eedcd0c1cbab65142c7b982b41e88341.tar
perl-URPM-efe14df5eedcd0c1cbab65142c7b982b41e88341.tar.gz
perl-URPM-efe14df5eedcd0c1cbab65142c7b982b41e88341.tar.bz2
perl-URPM-efe14df5eedcd0c1cbab65142c7b982b41e88341.tar.xz
perl-URPM-efe14df5eedcd0c1cbab65142c7b982b41e88341.zip
really clean up temporary files & directories properly
Diffstat (limited to 't')
-rw-r--r--t/00prepare.t10
-rw-r--r--t/parse.t6
2 files changed, 8 insertions, 8 deletions
diff --git a/t/00prepare.t b/t/00prepare.t
index 25b5c37..7ea2704 100644
--- a/t/00prepare.t
+++ b/t/00prepare.t
@@ -6,11 +6,11 @@ use Test::More tests => 1;
use Cwd;
chdir 't' if -d 't';
-for (qw(BUILD SOURCES RPMS RPMS/noarch tmp)) {
- mkdir $_;
+mkdir "tmp";
+for (qw(BUILD SOURCES RPMS RPMS/noarch)) {
+ mkdir "tmp/".$_;
}
# locally build a test rpm
-system(rpmbuild => '--define', '_topdir ' . Cwd::cwd(), '--define', '_tmppath ' . Cwd::cwd() . '/tmp/', '-bb', 'test-rpm.spec');
-ok( -f 'RPMS/noarch/test-rpm-1.0-1mdk.noarch.rpm', 'rpm created' );
+system(rpmbuild => '--define', '_topdir '. Cwd::cwd() . "/tmp/", '-bb', 'test-rpm.spec');
+ok( -f 'tmp/RPMS/noarch/test-rpm-1.0-1mdk.noarch.rpm', 'rpm created' );
-END { system('rm -rf BUILD tmp') };
diff --git a/t/parse.t b/t/parse.t
index b85bac5..cc9d3ba 100644
--- a/t/parse.t
+++ b/t/parse.t
@@ -18,9 +18,9 @@ URPM::setVerbosity(2);
my $a = new URPM;
ok($a);
-END { system('rm -rf hdlist.cz empty_hdlist.cz headers') }
+END { system('rm -rf hdlist.cz empty_hdlist.cz headers tmp') }
-my ($start, $end) = $a->parse_rpms_build_headers(rpms => [ "RPMS/noarch/test-rpm-1.0-1mdk.noarch.rpm" ], keep_all_tags => 1);
+my ($start, $end) = $a->parse_rpms_build_headers(rpms => [ "tmp/RPMS/noarch/test-rpm-1.0-1mdk.noarch.rpm" ], keep_all_tags => 1);
ok(@{$a->{depslist}} == 1);
my $pkg = $a->{depslist}[0];
ok($pkg);
@@ -69,7 +69,7 @@ rpm_is_jbj_version() ?
ok($pkg->is_platform_compat() > 0, "can evaluate platform score") :
pass('no platform compat');
-my $headers = eval { [ $b->parse_rpms_build_headers(rpms => [ "RPMS/noarch/test-rpm-1.0-1mdk.noarch.rpm" ],
+my $headers = eval { [ $b->parse_rpms_build_headers(rpms => [ "tmp/RPMS/noarch/test-rpm-1.0-1mdk.noarch.rpm" ],
dir => 'headers') ] };
is($@, '', 'parse_rpms_build_headers');
is(int @$headers, 1, 'parse_rpms_build_headers');