use strict;
use warnings;
-use Test::More tests => 110;
+use Test::More tests => 112;
sub is_blhc {
$file = "@{$file}";
}
- my $output = `./bin/blhc $options ./t/logs/$file 2>&1`;
+ $file = "./t/logs/$file" if $file;
+ my $output = `./bin/blhc $options $file 2>&1`;
if ($options) {
$options = ' '. $options;
# Usage.
-is_blhc 'empty', '--invalid', 2,
- 'Unknown option: invalid
-Usage:
+my $usage =
+ 'Usage:
blhc [*options*] *<dpkg-buildpackage build log file>..*
';
+is_blhc '', '--invalid', 2,
+ "Unknown option: invalid\n"
+ . $usage;
+is_blhc '', '', 2,
+ $usage;
# No compiler commands found.
LDFLAGS missing (-Wl,-z,relro): g++ -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -pthread -o ./testProgram ../src/test/testProgram.cpp
LDFLAGS missing (-Wl,-z,relro): gcc -o test test-a.o test-b.o test-c.a
LDFLAGS missing (-Wl,-z,relro): g++ -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security ../src/test/objs/test.o -o ../src/test/bin/test
-CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -c -o test test.s
+CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -c -o test test.S
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -E test.c
CFLAGS missing (-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security): gcc test.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc test.c
LDFLAGS missing (-fPIE -pie): g++ -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -pthread -Wl,-z,relro -o ../src/test/bin/test ../src/test/objs/test.o
LDFLAGS missing (-fPIE -pie -Wl,-z,relro): gcc -o test test-a.o test-b.o test-c.a
LDFLAGS missing (-fPIE -pie -Wl,-z,relro): g++ -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security ../src/test/objs/test.o -o ../src/test/bin/test
-CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -c -o test test.s
+CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -c -o test test.S
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -E test.c
CFLAGS missing (-g -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security): gcc test.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc test.c
LDFLAGS missing (-Wl,-z,now): g++ -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -pthread -Wl,-z,relro -o ../src/test/bin/test ../src/test/objs/test.o
LDFLAGS missing (-Wl,-z,relro -Wl,-z,now): gcc -o test test-a.o test-b.o test-c.a
LDFLAGS missing (-Wl,-z,relro -Wl,-z,now): g++ -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security ../src/test/objs/test.o -o ../src/test/bin/test
-CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -c -o test test.s
+CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -c -o test test.S
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -E test.c
CFLAGS missing (-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security): gcc test.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc test.c
LDFLAGS missing (-fPIE -pie -Wl,-z,now): g++ -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -pthread -Wl,-z,relro -o ../src/test/bin/test ../src/test/objs/test.o
LDFLAGS missing (-fPIE -pie -Wl,-z,relro -Wl,-z,now): gcc -o test test-a.o test-b.o test-c.a
LDFLAGS missing (-fPIE -pie -Wl,-z,relro -Wl,-z,now): g++ -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security ../src/test/objs/test.o -o ../src/test/bin/test
-CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -c -o test test.s
+CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -c -o test test.S
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -E test.c
CFLAGS missing (-g -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security): gcc test.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc test.c