aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-10-03 09:17:43 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-10-03 09:17:43 +0000
commite4edacf1184a40fb76d46e67501a35a2fcf117f5 (patch)
tree6cc4b84ab0eb2577c709c5f9e673504e5826caee
parent52f8e96232dbb7c7504a5a016a64d72421ffe76c (diff)
downloadperl-URPM-e4edacf1184a40fb76d46e67501a35a2fcf117f5.tar
perl-URPM-e4edacf1184a40fb76d46e67501a35a2fcf117f5.tar.gz
perl-URPM-e4edacf1184a40fb76d46e67501a35a2fcf117f5.tar.bz2
perl-URPM-e4edacf1184a40fb76d46e67501a35a2fcf117f5.tar.xz
perl-URPM-e4edacf1184a40fb76d46e67501a35a2fcf117f5.zip
Rebuild test rpm when running tests. Add cleanup to files.
-rw-r--r--MANIFEST2
-rw-r--r--Makefile.PL1
-rw-r--r--t/00prepare.t13
-rw-r--r--t/parse.t2
-rw-r--r--test-rpm-1.0-1mdk.noarch.rpmbin1876 -> 0 bytes
5 files changed, 16 insertions, 2 deletions
diff --git a/MANIFEST b/MANIFEST
index 0c7fea1..0300779 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -8,6 +8,7 @@ URPM/Build.pm
URPM/Query.pm
URPM/Resolve.pm
URPM/Signature.pm
+t/00prepare.t
t/fatal.t
t/parse.t
t/rpmdb.t
@@ -15,5 +16,4 @@ t/synthesis.t
ChangeLog
perl-URPM.spec
META.yml Module meta-data (added by MakeMaker)
-test-rpm-1.0-1mdk.noarch.rpm
test-rpm.spec
diff --git a/Makefile.PL b/Makefile.PL
index d0dcbec..cbcdee5 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -53,4 +53,5 @@ WriteMakefile(
LIBS => [ '-lrpm -lrpmio -lrpmdb -lpopt -lz -lbz2' ],
INC => '-I/usr/include/rpm',
dist => { COMPRESS => "bzip2", SUFFIX => ".bz2" },
+ realclean => { FILES => "t/RPMS/noarch/*" },
);
diff --git a/t/00prepare.t b/t/00prepare.t
new file mode 100644
index 0000000..d454c02
--- /dev/null
+++ b/t/00prepare.t
@@ -0,0 +1,13 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+use Test::More tests => 1;
+
+chdir 't' if -d 't';
+for (qw(BUILD RPMS RPMS/noarch)) {
+ mkdir $_;
+}
+# locally build a test rpm
+system(rpmbuild => '--define', '_topdir .', '-bb', '--clean', '../test-rpm.spec');
+ok( -f 'RPMS/noarch/test-rpm-1.0-1mdk.noarch.rpm', 'rpm created' );
diff --git a/t/parse.t b/t/parse.t
index 0b9618a..103f66a 100644
--- a/t/parse.t
+++ b/t/parse.t
@@ -14,7 +14,7 @@ ok($a);
END { unlink 'hdlist.cz' }
-my ($start, $end) = $a->parse_rpms_build_headers(rpms => [ "test-rpm-1.0-1mdk.noarch.rpm" ], keep_all_tags => 1);
+my ($start, $end) = $a->parse_rpms_build_headers(rpms => [ "t/RPMS/noarch/test-rpm-1.0-1mdk.noarch.rpm" ], keep_all_tags => 1);
ok(@{$a->{depslist}} == 1);
my $pkg = $a->{depslist}[0];
ok($pkg);
diff --git a/test-rpm-1.0-1mdk.noarch.rpm b/test-rpm-1.0-1mdk.noarch.rpm
deleted file mode 100644
index 4db8fc8..0000000
--- a/test-rpm-1.0-1mdk.noarch.rpm
+++ /dev/null
Binary files differ