use strict;
use warnings;
-use Test::More tests => 104;
+use Test::More tests => 110;
sub is_blhc {
NONVERBOSE BUILD: [CC] src/test_c.o
NONVERBOSE BUILD: [LD] src/test.o
NONVERBOSE BUILD: CC modules/server/test.c
+NONVERBOSE BUILD: C++ test/test.o
+NONVERBOSE BUILD: C++ test.cpp
NONVERBOSE BUILD: Compiling test/test.cc to ../build/test/test.o
NONVERBOSE BUILD: Building shared library ../build/test/libtest.so.1.2.3
NONVERBOSE BUILD: Compiling test.cc to ../build/test/test.o
is_blhc 'arch-avr32', '', 8,
$arch_avr32;
-is_blhc 'arch-i386', '', 8,
+my $arch_i386 =
'CFLAGS missing (-fstack-protector): gcc -D_FORTIFY_SOURCE=2 -g -O2 -fPIE --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -Wall -c test.c
LDFLAGS missing (-pie): gcc -fPIE -Wl,-z,relro -Wl,-z,now -o test test.o
';
+is_blhc 'arch-i386', '', 8,
+ $arch_i386;
-is_blhc 'arch-ia64', '', 8,
+my $arch_ia64 =
'CFLAGS missing (-fPIE): gcc -D_FORTIFY_SOURCE=2 -g -O2 -Wformat -Wformat-security -Werror=format-security -Wall -c test.c
LDFLAGS missing (-pie): gcc -fPIE -o test test.o
';
+is_blhc 'arch-ia64', '', 8,
+ $arch_ia64;
is_blhc 'arch-mipsel', '', 8,
'CFLAGS missing (-Werror=format-security): gcc -D_FORTIFY_SOURCE=2 -g -O2 -Wformat -Wformat-security -Wall -c test.c
LDFLAGS missing (-Wl,-z,relro): gcc -o test test.o `dpkg-buildflags --get CFLAGS`
';
+is_blhc 'debian-cmake', '', 32,
+ 'INVALID CMAKE: 2.8.7-2
+';
+
my $debian_hardening_wrapper =
'HARDENING WRAPPER: no checks possible, aborting
';
'W-no-compiler-commands
';
+is_blhc 'debian-cmake', '--buildd', 32,
+ 'W-invalid-cmake-used 2.8.7-2
+';
+
# multiple files
is_blhc ['good-all', 'good-library'], '--all', 0,
'';
+is_blhc ['arch-i386', 'arch-ia64'], '', 8,
+ $arch_i386 . $arch_ia64;
+
# No exit when multiple files are specified.
is_blhc ['bad-ldflags', 'empty', 'arch-avr32', 'debian-hardening-wrapper'], '', 25,
$bad_ldflags