diff options
Diffstat (limited to 't')
-rw-r--r-- | t/00prepare.t | 2 | ||||
-rw-r--r-- | t/parse.t | 3 | ||||
-rw-r--r-- | t/test-rpm.spec | 35 |
3 files changed, 38 insertions, 2 deletions
diff --git a/t/00prepare.t b/t/00prepare.t index 7261e48..fc29900 100644 --- a/t/00prepare.t +++ b/t/00prepare.t @@ -10,7 +10,7 @@ for (qw(BUILD RPMS RPMS/noarch tmp)) { mkdir $_; } # locally build a test rpm -system(rpmbuild => '--define', '_topdir .', '--define', '_tmppath ' . Cwd::cwd() . '/tmp/', '-bb', '../test-rpm.spec'); +system(rpmbuild => '--define', '_topdir .', '--define', '_tmppath ' . Cwd::cwd() . '/tmp/', '-bb', 'test-rpm.spec'); ok( -f 'RPMS/noarch/test-rpm-1.0-1mdk.noarch.rpm', 'rpm created' ); END { system('rm -rf BUILD tmp') }; @@ -33,6 +33,7 @@ TODO: { q/get headers from parsing rpm/); } +mkdir 't/headers'; system('touch t/headers/empty'); is(URPM->new->parse_hdlist('t/headers/empty'), undef, 'empty header'); system('echo FOO > t/headers/bad'); @@ -100,7 +101,7 @@ ok(URPM::rpmvercmp("1:1-1mdk", "2:1-1mdk") == -1, "epoch 1 vs 2 = -1"); } { - my $pkg = URPM::spec2srcheader("test-rpm.spec"); + my $pkg = URPM::spec2srcheader("t/test-rpm.spec"); ok(defined $pkg, "Parsing a spec works"); is($pkg->get_tag(1000), 'test-rpm', 'parsed correctly'); $pkg = URPM::spec2srcheader("doesnotexist.spec"); diff --git a/t/test-rpm.spec b/t/test-rpm.spec new file mode 100644 index 0000000..bbd60f1 --- /dev/null +++ b/t/test-rpm.spec @@ -0,0 +1,35 @@ +# $Id$ +Summary: test rpm for perl-URPM test suite +BuildArch: noarch +Name: test-rpm +Version: 1.0 +Release: 1mdk +License: GPL +Group: Application/Development +BuildRoot: %{_tmppath}/%{name}-root + +%description +test rpm + +%prep + +%build + +%install +rm -rf $RPM_BUILD_ROOT +mkdir -p $RPM_BUILD_ROOT%_sysconfdir + +date >> $RPM_BUILD_ROOT%_sysconfdir/%name + +%clean +rm -rf $RPM_BUILD_ROOT + +%files +%defattr(-,root,root) +%config(noreplace) %_sysconfdir/%name + +%changelog +* Thu Apr 22 2004 Olivier Thauvin <thauvin@aerov.jussieu.fr> 1-1mdk +- initial build + + |