summaryrefslogtreecommitdiffstats
path: root/t/02create_pkgs.t
diff options
context:
space:
mode:
Diffstat (limited to 't/02create_pkgs.t')
-rw-r--r--t/02create_pkgs.t24
1 files changed, 24 insertions, 0 deletions
diff --git a/t/02create_pkgs.t b/t/02create_pkgs.t
new file mode 100644
index 00000000..8a716226
--- /dev/null
+++ b/t/02create_pkgs.t
@@ -0,0 +1,24 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+use Test::More 'no_plan';
+
+chdir 't' if -d 't';
+system('rm -rf BUILD RPMS media');
+for (qw(media BUILD RPMS RPMS/noarch)) {
+ mkdir $_;
+}
+# locally build a test rpms
+foreach my $spec (glob("SPECS/*.spec")) {
+ system_("rpmbuild --quiet --define '_topdir .' -bb --clean $spec");
+ my ($name) = $spec =~ m!([^/]*)\.spec$!;
+ mkdir "media/$name";
+ system_("mv RPMS/*/*.rpm media/$name");
+}
+
+sub system_ {
+ my ($cmd) = @_;
+ system($cmd);
+ ok($? == 0, $cmd);
+}