aboutsummaryrefslogtreecommitdiff
path: root/t/test.t
diff options
context:
space:
mode:
Diffstat (limited to 't/test.t')
-rwxr-xr-xt/test.t43
1 files changed, 24 insertions, 19 deletions
diff --git a/t/test.t b/t/test.t
index 4965bc1..3af92d7 100755
--- a/t/test.t
+++ b/t/test.t
@@ -10,7 +10,7 @@ use Text::Diff;
use lib ".";
use SBO::Lib;
-my $sbo_home = '/home/d4wnr4z0r/sbo.git/slackbuilds';
+my $sbo_home = '/usr/sbo';
# 1, open_read, open_fh tests
my $fh = open_read ('./test.t');
@@ -20,20 +20,20 @@ close $fh;
# 2-7, config settings tests;
ok (defined $SBO::Lib::tempdir, '$tempdir is defined');
is ($SBO::Lib::config{DISTCLEAN}, 'FALSE', 'config{DISTCLEAN} is good');
-is ($SBO::Lib::config{JOBS}, 2, 'config{JOBS} is good');
+is ($SBO::Lib::config{JOBS}, 'FALSE', 'config{JOBS} is good');
is ($SBO::Lib::config{NOCLEAN}, 'FALSE', 'config{NOCLEAN} is good');
-is ($SBO::Lib::config{PKG_DIR}, 'FALSE', 'config{PKG_DIR} is good');
+is ($SBO::Lib::config{PKG_DIR}, '/usr/sbo/packages', 'config{PKG_DIR} is good');
is ($SBO::Lib::config{SBO_HOME}, "$sbo_home", 'config{SBO_HOME} is good');
# 8, show_version test
is (show_version, 1, 'show_version is good');
# 9, get_slack_version test
-is (get_slack_version, '14.0', 'get_slack_version is good');
+is (get_slack_version, '13.37', 'get_slack_version is good');
# 10-11, chk_slackbuilds_txt tests
is (chk_slackbuilds_txt, 1, 'chk_slackbuilds_txt is good');
-move ("$sbo_home/SLACKBUILDS.TXT", "$sbo_home/SLACKBUILDS.TXT.moved");
+move ("$sbo_home/SLACKBUILDS.TXT", "$sbo_home/SLACKBUILDS.TXT.moved") or say "Unable to move SLACKBUILDS.TXT: $!";
is (chk_slackbuilds_txt, undef, 'chk_slackbuilds_txt returns false with no SLACKBUILDS.TXT');
move ("$sbo_home/SLACKBUILDS.TXT.moved", "$sbo_home/SLACKBUILDS.TXT");
@@ -47,12 +47,12 @@ is (slackbuilds_or_fetch, 1, 'slackbuilds_or_fetch is good');
print "pseudo-random sampling of get_installed_sbos output...\n";
my $installed = get_installed_sbos;
for my $key (keys @$installed) {
- is ($$installed[$key]{version}, '1.13') if $$installed[$key]{name} eq 'OpenAL';
- is ($$installed[$key]{version}, '9.5.1_enu') if $$installed[$key]{name} eq 'adobe-reader';
- is ($$installed[$key]{version}, '4.1.3') if $$installed[$key]{name} eq 'libdvdnav';
- is ($$installed[$key]{version}, '0.8.8.4') if $$installed[$key]{name} eq 'libmodplug';
+ is ($$installed[$key]{version}, '1.1.21') if $$installed[$key]{name} eq 'perlprimer';
+ is ($$installed[$key]{version}, '1.1.0') if $$installed[$key]{name} eq 'matplotlib';
+ is ($$installed[$key]{version}, '0.4.16') if $$installed[$key]{name} eq 'orc';
+ is ($$installed[$key]{version}, '1.6.1') if $$installed[$key]{name} eq 'numpy';
is ($$installed[$key]{version}, '3.12.4') if $$installed[$key]{name} eq 'mozilla-nss';
- is ($$installed[$key]{version}, '2.5.0') if $$installed[$key]{name} eq 'zdoom';
+ is ($$installed[$key]{version}, '4.0.0.8') if $$installed[$key]{name} eq 'skype';
}
print "completed pseudo-random testing of get_installed_sbos \n";
@@ -63,12 +63,12 @@ is (get_sbo_location 'omgwtfbbq', undef, 'get_sbo_location returns false with no
# 21-22, get_available_updates tests
my $updates = get_available_updates;
for my $key (keys @$updates) {
- is ($$updates[$key]{installed}, '1.15', '$$updates[$key]{installed} good for mutagen') if $$updates[$key]{name} eq 'mutagen';
- is ($$updates[$key]{update}, '1.20', '$$updates[$key]{update} good for mutagen') if $$updates[$key]{name} eq 'mutagen';
+ is ($$updates[$key]{installed}, '18.0.1025.142', '$$updates[$key]{installed} good for chromium') if $$updates[$key]{name} eq 'chromium';
+ is ($$updates[$key]{update}, '20.0.1132.57', '$$updates[$key]{update} good for chromium') if $$updates[$key]{name} eq 'chromium';
}
# 23, get_arch test
-is (get_arch, 'x86_64', 'get_arch is good');
+is (get_arch, 'i686', 'get_arch is good');
# 24-25, get_download_info tests
my %dl_info = get_download_info (LOCATION => "$sbo_home/system/wine", X64 => 0);
@@ -108,7 +108,7 @@ ok (check_x32 "$sbo_home/system/wine", 'check_x32 true for 32-bit only wine');
ok (!(check_x32 "$sbo_home/system/ifuse"), 'check_x32 false for not-32-bit-only ifuse');
# 37, check_multilib tests
-ok (check_multilib, 'check_multilib good');
+#ok (check_multilib, 'check_multilib good');
# 38-39, create_symlinks tests
%downloads = get_sbo_downloads (LOCATION => "$sbo_home/system/wine", 32 => 1);
@@ -239,6 +239,8 @@ for my $found (@$findings) {
$section = 'multimedia';
} elsif ($key eq 'gnome-python-desktop') {
$section = 'python';
+ } elsif ($key eq 'gsettings-desktop-schemas') {
+ $section = 'system';
}
is ($$found{$key}, "$sbo_home/$section/$key", 'perform_search good for $search eq desktop');
}
@@ -247,14 +249,17 @@ for my $found (@$findings) {
# 75, get_inst_names test
$installed = get_installed_sbos;
my $inst_names = get_inst_names $installed;
-ok ('zdoom' ~~ @$inst_names, 'get_inst_names is good');
+ok ('skype' ~~ @$inst_names, 'get_inst_names is good');
# 76-81, get_reqs tests
$SBO::Lib::no_reqs = 0;
-ok (! (get_requires 'stops', "$sbo_home/audio/stops"), 'get_requires good for circular requirements');
-ok (! (get_requires 'smc', "$sbo_home/games/smc"), 'get_requires good for REQUIRES="%README%"');
+#ok (! (get_requires 'stops', "$sbo_home/audio/stops"), 'get_requires good for circular requirements');
+#ok (! (get_requires 'smc', "$sbo_home/games/smc"), 'get_requires good for REQUIRES="%README%"');
ok (! (get_requires 'krb5', "$sbo_home/network/krb5"), 'get_requires good for REQUIRES=""');
-my $reqs = get_requires 'matchbox-desktop', "$sbo_home/desktop/matchbox-desktop";
+open $fh, '<', "$sbo_home/desktop/matchbox-desktop/README";
+my $readme = do {local $/; <$fh>};
+close $fh;
+my $reqs = get_requires 'matchbox-desktop', $readme;
my $say = 'get_requires good for normal req list';
is ($$reqs[0], 'libmatchbox', $say);
is ($$reqs[1], 'matchbox-window-manager', $say);
@@ -262,7 +267,7 @@ is ($$reqs[2], 'matchbox-common', $say);
# 82-85, get_user_group tests
$fh = open_read "$sbo_home/network/nagios/README";
-my $readme = do {local $/; <$fh>};
+$readme = do {local $/; <$fh>};
close $fh;
my $cmds = get_user_group $readme;
is ($$cmds[0], 'groupadd -g 213 nagios', 'get_user_group good for # groupadd');