]> ruderich.org/simon Gitweb - blhc/blhc.git/blobdiff - t/tests.t
t: Fix to handle buildd output and exit code change.
[blhc/blhc.git] / t / tests.t
index 1f68cd4a4fea426ef54767201baf10ebaed5d8a5..b2e3d6d46656951af124bccd94ec6c9dfb0b9fd6 100644 (file)
--- a/t/tests.t
+++ b/t/tests.t
@@ -19,7 +19,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 192;
+use Test::More tests => 194;
 
 
 sub is_blhc {
@@ -61,7 +61,7 @@ is_blhc '', '', 2,
         $usage;
 
 is_blhc '', '--version', 0,
-        'blhc 0.02  Copyright (C) 2012  Simon Ruderich
+        'blhc 0.03  Copyright (C) 2012  Simon Ruderich
 
 This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
@@ -517,8 +517,14 @@ CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -D_FORTIFY_SOURCE=2 -g -O2 -fstack-p
 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=0 -c test-d.c
 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -D_FORTIFY_SOURCE=0 -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-e.c
 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -D_FORTIFY_SOURCE=1 -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-f.c
+CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -U_FORTIFY_SOURCE   -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -c test-g.c
+CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -U_FORTIFY_SOURCE   -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-h.c
+CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -U_FORTIFY_SOURCE -c test-i.c
 ';
 
+is_blhc 'bad-cppflags', '--ignore-flag -D_FORTIFY_SOURCE=2', 0,
+        '';
+
 my $bad_ldflags =
         'LDFLAGS missing (-Wl,-z,relro): gcc -o test test-a.o test-b.o test-c.o -ltest
 ';
@@ -850,39 +856,39 @@ is_blhc 'false-positives', '', 1,
 
 # buildd support
 
-is_blhc 'empty', '--buildd', 1,
-        'I-no-compiler-commands
+is_blhc 'empty', '--buildd', 0,
+        'I-no-compiler-commands||
 ';
 
 is_blhc 'buildd-package-details', '--buildd', 0,
         '';
 
-is_blhc 'buildd-dpkg-dev', '--buildd', 8,
-        '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', '--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', 8,
-        'W-dpkg-buildflags-missing CFLAGS 3 (of 6), CXXFLAGS 1 (of 1) 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', 8,
-        '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 'debian-hardening-wrapper', '--buildd', 16,
-        'I-hardening-wrapper-used
+is_blhc 'debian-hardening-wrapper', '--buildd', 0,
+        'I-hardening-wrapper-used||
 ';
 
-is_blhc 'buildd-verbose-build', '--buildd', 4,
-        'W-compiler-flags-hidden 1 (of 5) hidden
+is_blhc 'buildd-verbose-build', '--buildd', 0,
+        'W-compiler-flags-hidden|1 (of 5) hidden|
 ';
 
-is_blhc 'make', '--buildd', 1,
-        'I-no-compiler-commands
+is_blhc 'make', '--buildd', 0,
+        'I-no-compiler-commands||
 ';
 
-is_blhc 'debian-cmake', '--buildd', 32,
-        'I-invalid-cmake-used 2.8.7-1
+is_blhc 'debian-cmake', '--buildd', 0,
+        'I-invalid-cmake-used|2.8.7-1|
 ';