aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Guldstrand <andreas.guldstrand@gmail.com>2016-04-16 00:05:10 +0200
committerAndreas Guldstrand <andreas.guldstrand@gmail.com>2016-04-16 00:05:10 +0200
commit301e8781a3d80c371bf3f68e9b6cfd27ddd161ad (patch)
tree16401c458b0d05e12ab04775a973b8ac893a667f
parent01b15204ee6e2c3b583e5a4479f53d2651bb20aa (diff)
downloadsbotools2-301e8781a3d80c371bf3f68e9b6cfd27ddd161ad.tar.xz
Test show_usage output for all the sbo* commands
-rwxr-xr-xsboconfig2
-rwxr-xr-xsbofind12
-rwxr-xr-xsboinstall2
-rwxr-xr-xsboremove2
-rwxr-xr-xt/15-usage.t185
5 files changed, 194 insertions, 9 deletions
diff --git a/sboconfig b/sboconfig
index 2a90d46..e9cd795 100755
--- a/sboconfig
+++ b/sboconfig
@@ -39,7 +39,7 @@ Config options (defaults shown):
-j|--jobs FALSE:
JOBS: numeric -j setting to feed to make for multicore systems.
-p|--pkg-dir FALSE:
- PKG_DIR: set a directory to store packages in.
+ PKG_DIR: set a directory to store packages in.
-s|--sbo-home /usr/sbo:
SBO_HOME: set the SBo directory.
-o|--local-overrides FALSE:
diff --git a/sbofind b/sbofind
index 0adb1f7..8fd08f9 100755
--- a/sbofind
+++ b/sbofind
@@ -25,18 +25,18 @@ Usage: $self (search_term)
Options:
-h|--help:
- this screen.
+ this screen.
-v|--verison:
- version information.
+ version information.
-i|--info:
- show the .info for each found item.
+ show the .info for each found item.
-r|--readme:
- show the README for each found item.
+ show the README for each found item.
-q|--queue:
- show the build queue for each found item.
+ show the build queue for each found item.
Example:
- $self libsexy
+ $self libsexy
EOF
return 1;
diff --git a/sboinstall b/sboinstall
index 7e15183..ccd4683 100755
--- a/sboinstall
+++ b/sboinstall
@@ -31,7 +31,7 @@ Options (defaults shown first where applicable):
-c|--noclean (FALSE|TRUE):
set whether or not to clean working files/directories after the build.
-d|--distclean (TRUE|FALSE):
- set whether or not to clean distfiles afterward.
+ set whether or not to clean distfiles afterward.
-i|--noinstall:
do not run installpkg at the end of the build process.
-j|--jobs (FALSE|#):
diff --git a/sboremove b/sboremove
index 0566192..05b560c 100755
--- a/sboremove
+++ b/sboremove
@@ -31,7 +31,7 @@ Options (defaults shown first where applicable):
-a|--alwaysask:
always ask to remove, even if required by other packages on system.
-Note: optional dependencies need to be removed separately.
+Note: optional dependencies need to be removed separately.
EOF
return 1;
diff --git a/t/15-usage.t b/t/15-usage.t
new file mode 100755
index 0000000..d282cb8
--- /dev/null
+++ b/t/15-usage.t
@@ -0,0 +1,185 @@
+#!/usr/bin/env perl
+
+use 5.16.0;
+use strict;
+use warnings FATAL => 'all';
+use Test::More;
+use Capture::Tiny qw/ capture_merged /;
+use FindBin '$RealBin';
+use lib $RealBin;
+use lib "$RealBin/../SBO-Lib/lib";
+use Test::Sbotools qw/ make_slackbuilds_txt sbocheck sboclean sboconfig sbofind sboinstall sboremove sbosnap sboupgrade /;
+
+plan tests => 8;
+
+make_slackbuilds_txt();
+
+# 1-8: test -h output of sbo* scripts
+
+## sbocheck
+sbocheck '-h', { expected => <<'SBOCHECK' };
+Usage: sbocheck
+
+Options:
+ -h|--help:
+ this screen.
+ -v|--version:
+ version information.
+
+SBOCHECK
+
+## sboclean
+sboclean '-h', { expected => <<'SBOCLEAN' };
+Usage: sboclean (options) [package]
+
+Options:
+ -h|--help:
+ this screen.
+ -v|--version:
+ version information.
+ -d|--clean-dist:
+ clean distfiles.
+ -w|--clean-work:
+ clean working directories.
+ -i|--interactive:
+ be interactive.
+
+SBOCLEAN
+
+## sboconfig
+sboconfig '-h', { expected => <<'SBOCONFIG' };
+Usage: sboconfig [options] [arguments]
+
+Options:
+ -h: this screen.
+ -v: version information.
+ -l: show current options.
+
+Config options (defaults shown):
+ -c|--clean FALSE:
+ NOCLEAN: if TRUE, do NOT clean up after building by default.
+ -d|--distclean FALSE:
+ DISTCLEAN: if TRUE, DO clean distfiles by default after building.
+ -j|--jobs FALSE:
+ JOBS: numeric -j setting to feed to make for multicore systems.
+ -p|--pkg-dir FALSE:
+ PKG_DIR: set a directory to store packages in.
+ -s|--sbo-home /usr/sbo:
+ SBO_HOME: set the SBo directory.
+ -o|--local-overrides FALSE:
+ LOCAL_OVERRIDES: a directory containing local overrides.
+ -V|--slackware-version FALSE:
+ SLACKWARE_VERSION: use the SBo repository for this version.
+ -r|--repo FALSE:
+ REPO: use a repository other than SBo.
+
+SBOCONFIG
+
+## sbofind
+sbofind '-h', { expected => <<'SBOFIND' };
+Usage: sbofind (search_term)
+
+Options:
+ -h|--help:
+ this screen.
+ -v|--verison:
+ version information.
+ -i|--info:
+ show the .info for each found item.
+ -r|--readme:
+ show the README for each found item.
+ -q|--queue:
+ show the build queue for each found item.
+
+Example:
+ sbofind libsexy
+
+SBOFIND
+
+## sboinstall
+sboinstall '-h', { expected => <<'SBOINSTALL' };
+Usage: sboinstall [options] sbo
+
+Options (defaults shown first where applicable):
+ -h|--help:
+ this screen.
+ -v|--version:
+ version information.
+ -c|--noclean (FALSE|TRUE):
+ set whether or not to clean working files/directories after the build.
+ -d|--distclean (TRUE|FALSE):
+ set whether or not to clean distfiles afterward.
+ -i|--noinstall:
+ do not run installpkg at the end of the build process.
+ -j|--jobs (FALSE|#):
+ specify "-j" setting to make, for multicore systems; overrides conf file.
+ -p|--compat32:
+ install an SBo as a -compat32 pkg on a multilib x86_64 system.
+ -r|--nointeractive:
+ non-interactive; skips README and all prompts.
+ -R|--norequirements:
+ view the README but do not parse requirements, commands, or options.
+
+SBOINSTALL
+
+## sboremove
+sboremove '-h', { expected => <<'SBOREMOVE' };
+Usage: sboremove [options] sbo
+
+Options (defaults shown first where applicable):
+ -h|--help:
+ this screen.
+ -v|--version:
+ version information.
+ -a|--alwaysask:
+ always ask to remove, even if required by other packages on system.
+
+Note: optional dependencies need to be removed separately.
+
+SBOREMOVE
+
+## sbosnap
+sbosnap '-h', { expected => <<'SBOSNAP' };
+Usage: sbosnap [options|command]
+
+Options:
+ -h|--help:
+ this screen.
+ -v|--version:
+ version information.
+
+Commands:
+ fetch: initialize a local copy of the slackbuilds.org tree.
+ update: update an existing local copy of the slackbuilds.org tree.
+ (generally, you may prefer "sbocheck" over "sbosnap update")
+
+SBOSNAP
+
+## sboupgrade
+sboupgrade '-h', { expected => <<'SBOUPGRADE' };
+Usage: sboupgrade (options) [package]
+
+Options (defaults shown first where applicable):
+ -h|--help:
+ this screen.
+ -v|--version:
+ version information.
+ -c|--noclean (FALSE|TRUE):
+ set whether or not to clean working directories after building.
+ -d|--distclean (TRUE|FALSE):
+ set whether or not to clean distfiles afterward.
+ -f|--force:
+ force an update, even if the "upgrade" version is the same or lower.
+ -i|--noinstall:
+ do not run installpkg at the end of the build process.
+ -j|--jobs (FALSE|#):
+ specify "-j" setting to make, for multicore systems; overrides conf file.
+ -r|--nointeractive:
+ non-interactive; skips README and all prompts.
+ -z|--force-reqs:
+ when used with -f, will force rebuilding an SBo's requirements as well.
+ --all
+ this flag will upgrade everything reported by sbocheck(1).
+
+SBOUPGRADE
+