+is_blhc 'debian-cmake-2', '', 32,
+ 'INVALID CMAKE: 2.8.7-2
+';
+is_blhc 'debian-cmake-ok', '', 0,
+ '';
+
+my $debian_hardening_wrapper =
+ 'HARDENING WRAPPER: no checks possible, aborting
+';
+is_blhc 'debian-hardening-wrapper', '', 16,
+ $debian_hardening_wrapper;
+is_blhc 'debian-hardening-wrapper-old-build-depends', '', 16,
+ $debian_hardening_wrapper;
+is_blhc 'debian-hardening-wrapper-pbuilder', '', 16,
+ $debian_hardening_wrapper;
+
+
+# false positives
+
+is_blhc 'false-positives', '', 0,
+ '';
+
+
+# buildd support
+
+is_blhc 'empty', '--buildd', 0,
+ 'I-no-compiler-commands||
+';
+
+is_blhc 'buildd-package-details', '--buildd', 0,
+ '';
+
+is_blhc 'buildd-dpkg-dev', '--buildd', 0,
+ 'W-dpkg-buildflags-missing|CPPFLAGS 7 (of 7), CFLAGS 6 (of 6), CXXFLAGS 1 (of 1), LDFLAGS 2 (of 2) missing|
+';
+
+is_blhc 'buildd-dpkg-dev-old', '--buildd', 0,
+ 'W-dpkg-buildflags-missing|CFLAGS 3 (of 6), CXXFLAGS 1 (of 1) missing|
+';
+
+is_blhc 'buildd-dpkg-dev-missing', '--buildd', 0,
+ 'W-dpkg-buildflags-missing|CFLAGS 3 (of 6), CXXFLAGS 1 (of 1) missing|
+';
+
+is_blhc 'buildd-gcc-pie', '--buildd --all', 0,
+ 'W-dpkg-buildflags-missing|CFLAGS 1 (of 1), LDFLAGS 1 (of 1) missing|
+';
+is_blhc 'buildd-gcc-pie-builtin-wrong-arch', '--buildd --all', 0,
+ 'W-dpkg-buildflags-missing|CFLAGS 1 (of 1), LDFLAGS 1 (of 1) missing|
+';
+is_blhc 'buildd-gcc-pie-builtin', '--buildd', 0, '';
+is_blhc 'buildd-gcc-pie-builtin', '--buildd --all', 0, '';
+
+# Older dpkg versions use -fstack-protector instead of -strong.
+is_blhc 'buildd-dpkg-fstack-protector', '--buildd', 0,
+ '';
+is_blhc 'buildd-dpkg-fstack-protector-missing', '--buildd', 0,
+ 'W-dpkg-buildflags-missing|CFLAGS 5 (of 5) missing|
+';
+
+is_blhc 'debian-hardening-wrapper', '--buildd', 0,
+ 'I-hardening-wrapper-used||
+';
+is_blhc 'debian-hardening-wrapper-pbuilder', '--buildd', 0,
+ 'I-hardening-wrapper-used||
+';
+
+is_blhc 'buildd-verbose-build', '--buildd', 0,
+ 'W-compiler-flags-hidden|3 (of 5) hidden|
+';
+
+is_blhc 'make', '--buildd', 0,
+ 'I-no-compiler-commands||
+';
+
+is_blhc 'debian-cmake', '--buildd', 0,
+ 'I-invalid-cmake-used|2.8.7-1|
+';
+
+
+# debian specific settings
+
+is_blhc 'debian-gcc-pie', '--debian', 0, '';
+
+
+# multiple files
+
+is_blhc ['good', 'good-pie', 'good-bindnow', 'good-all', 'good-multiline', 'good-library'], '', 0,
+ "checking './t/logs/good'...
+checking './t/logs/good-pie'...
+checking './t/logs/good-bindnow'...
+checking './t/logs/good-all'...
+checking './t/logs/good-multiline'...
+checking './t/logs/good-library'...
+";
+is_blhc ['good-all', 'good-library'], '--all', 0,
+ "checking './t/logs/good-all'...
+checking './t/logs/good-library'...
+";
+
+is_blhc ['arch-i386', 'arch-ia64'], '', 8,
+ "checking './t/logs/arch-i386'...\n"
+ . $arch_i386
+ . "checking './t/logs/arch-ia64'...\n"
+ . $arch_ia64;
+
+# No exit when multiple files are specified.
+is_blhc ['bad-ldflags', 'empty', 'arch-avr32', 'debian-hardening-wrapper'], '', 25,
+ "checking './t/logs/bad-ldflags'...\n"
+ . $bad_ldflags
+ . "checking './t/logs/empty'...\n"
+ . $empty
+ . "checking './t/logs/arch-avr32'...\n"
+ . $arch_avr32
+ . "checking './t/logs/debian-hardening-wrapper'...\n"
+ . $debian_hardening_wrapper
+ ;
+
+# Ignore works correctly with multiple architectures.
+is_blhc ['arch-i386', 'arch-amd64', 'arch-avr32', 'ignore-flag'],
+ '--ignore-arch-flag i386:-fstack-protector-strong --ignore-arch-flag mipsel:-Werror=format-security', 8,
+ "checking './t/logs/arch-i386'...
+LDFLAGS missing (-pie): gcc -fPIE -Wl,-z,relro -Wl,-z,now -o test test.o
+checking './t/logs/arch-amd64'...
+CFLAGS missing (-fstack-protector-strong): gcc -D_FORTIFY_SOURCE=2 -g -O2 -fPIE -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
+checking './t/logs/arch-avr32'...
+CFLAGS missing (-fstack-protector-strong): gcc -D_FORTIFY_SOURCE=2 -g -O2 -Wformat -Wformat-security -Werror=format-security -Wall -c test.c
+checking './t/logs/ignore-flag'...
+CFLAGS missing (-g): gcc -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-b.c
+CFLAGS missing (-O2): gcc -g -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-c.c
+"
+ ;
+
+is_blhc ['arch-i386', 'arch-amd64', 'arch-avr32', 'ignore-line'],
+ '--ignore-arch-line "i386:gcc .+ -fPIE .+" --ignore-arch-line "mipsel:gcc .+ -Wl,-z,relro -Wl,-z,now .+"', 8,
+ "checking './t/logs/arch-i386'...
+LDFLAGS missing (-pie): gcc -fPIE -Wl,-z,relro -Wl,-z,now -o test test.o
+checking './t/logs/arch-amd64'...
+CFLAGS missing (-fstack-protector-strong): gcc -D_FORTIFY_SOURCE=2 -g -O2 -fPIE -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
+checking './t/logs/arch-avr32'...
+CFLAGS missing (-fstack-protector-strong): gcc -D_FORTIFY_SOURCE=2 -g -O2 -Wformat -Wformat-security -Werror=format-security -Wall -c test.c
+checking './t/logs/ignore-line'...
+CFLAGS missing (-g -O2 -fstack-protector-strong -Wformat -Werror=format-security): ./prepare-script gcc test-a.c test-b.c test-c.c
+CPPFLAGS missing (-D_FORTIFY_SOURCE=2): ./prepare-script gcc test-a.c test-b.c test-c.c
+LDFLAGS missing (-Wl,-z,relro): ./prepare-script gcc test-a.c test-b.c test-c.c
+CFLAGS missing (-g -O2 -fstack-protector-strong -Wformat -Werror=format-security): ./prepare-script gcc test-a.c
+CPPFLAGS missing (-D_FORTIFY_SOURCE=2): ./prepare-script gcc test-a.c
+LDFLAGS missing (-Wl,-z,relro): ./prepare-script gcc test-a.c
+CFLAGS missing (-g -O2 -fstack-protector-strong -Wformat -Werror=format-security): ./prepare-script gcc test-b.c
+CPPFLAGS missing (-D_FORTIFY_SOURCE=2): ./prepare-script gcc test-b.c
+LDFLAGS missing (-Wl,-z,relro): ./prepare-script gcc test-b.c
+CFLAGS missing (-g -O2 -fstack-protector-strong -Wformat -Werror=format-security): ./prepare-script gcc test-c.c
+CPPFLAGS missing (-D_FORTIFY_SOURCE=2): ./prepare-script gcc test-c.c
+LDFLAGS missing (-Wl,-z,relro): ./prepare-script gcc test-c.c
+"
+ ;