use strict;
use warnings;
-use Test::More tests => 182;
+use Test::More tests => 190;
sub is_blhc {
$options = ' '. $options;
}
is $? >> 8, $exit, "$file$options (exit code)";
- is $output, $expected, "$file$options (output)";
+ # Perform regex or string match.
+ my $cmd = (ref $expected eq 'Regexp')
+ ? \&like
+ : \&is;
+ &$cmd($output, $expected, "$file$options (output)");
}
along with this program. If not, see <http://www.gnu.org/licenses/>.
';
+is_blhc '', '--help', 1,
+ qr/^Usage:
+ blhc \[\*options\*\] \*<dpkg-buildpackage build log file>\.\.\*
+
+Options:
+/s;
+
+is_blhc 'doesnt-exist', '', 2,
+ qr{^No such file or directory at \./bin/blhc line \d+\.$};
+
# No compiler commands found.
Usage:
blhc [*options*] *<dpkg-buildpackage build log file>..*
+';
+is_blhc 'ignore-flag', '--ignore-arch-flag :amd64', 2,
+ 'Value ":amd64" invalid for option ignore-arch-flag ("arch:flag" expected)
+Usage:
+ blhc [*options*] *<dpkg-buildpackage build log file>..*
+
';
# Wrong architecture.
Usage:
blhc [*options*] *<dpkg-buildpackage build log file>..*
+';
+is_blhc 'ignore-line', '--ignore-arch-line :amd64', 2,
+ 'Value ":amd64" invalid for option ignore-arch-line ("arch:line" expected)
+Usage:
+ blhc [*options*] *<dpkg-buildpackage build log file>..*
+
';
# Wrong architecture.