summaryrefslogtreecommitdiff
path: root/Perl-RPM/t/04_utils.t
blob: 751f5687ed7f3b860f3fc8205be4eedb1d48e19f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/perl

# Test the basic util functions

use RPM;

print "1..2\n";

$arch = $os = '';

open(PIPE, "rpm --showrc |");
while (defined($line = <PIPE>))
{
    chomp $line;

    $line =~ /^build arch\s*:\s*(\S+)\s*$/ and $arch = $1;
    $line =~ /^build os\s*:\s*(\S+)\s*$/ and $os = $1;
}
close(PIPE);

print 'not ' unless ($arch eq GetArchName);
print "ok 1\n";

print 'not ' unless ($os eq GetOsName);
print "ok 2\n";

exit;