From: Simon Ruderich Date: Sat, 24 Mar 2012 14:19:22 +0000 (+0100) Subject: Handle false positive from make. X-Git-Tag: 0.01~67 X-Git-Url: https://ruderich.org/simon/gitweb/?a=commitdiff_plain;h=f939b4685a7cb1e1003fbd81a4f136c254b554a4;p=blhc%2Fblhc.git Handle false positive from make. --- diff --git a/MANIFEST b/MANIFEST index c5b34a5..2932b8a 100644 --- a/MANIFEST +++ b/MANIFEST @@ -32,5 +32,6 @@ t/logs/good-library t/logs/good-multiline t/logs/good-pie t/logs/libtool +t/logs/make t/logs/verbose-build t/tests.t diff --git a/bin/blhc b/bin/blhc index 5c01ada..6c3853a 100755 --- a/bin/blhc +++ b/bin/blhc @@ -466,6 +466,8 @@ while (my $line = <>) { or $line =~ /^\s*(?:- )?(?:HOST_)?(?:CC|CXX)\s*=\s*$cc_regex\s*$/ or $line =~ /^\s*-- Check for working (?:C|CXX) compiler: / or $line =~ /^\s*(?:echo )?Using [A-Z_]+\s*=\s*/; + # `make` output. + next if $line =~ /^Making [a-z]+ in \S+/; # e.g. "[...] in c++" # Check if additional hardening options were used. Used to ensure # they are used for the complete build. diff --git a/t/logs/make b/t/logs/make new file mode 100644 index 0000000..1b5b31e --- /dev/null +++ b/t/logs/make @@ -0,0 +1,6 @@ +dpkg-buildpackage: source package test + +# Output by make which should be ignored. + +Making all in c++ +Making install in c++ diff --git a/t/tests.t b/t/tests.t index 46a789c..3b9c332 100644 --- a/t/tests.t +++ b/t/tests.t @@ -19,7 +19,7 @@ use strict; use warnings; -use Test::More tests => 88; +use Test::More tests => 90; sub is_blhc { @@ -396,12 +396,17 @@ CFLAGS missing (-Werror=format-security): cd /tmp/test/src && /usr/bin/gcc -g -O '; -# configure +# configure/make is_blhc 'configure', '', 1, 'No compiler commands! '; +is_blhc 'make', '', 1, + 'No compiler commands! +'; + + # cc