From f939b4685a7cb1e1003fbd81a4f136c254b554a4 Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Sat, 24 Mar 2012 15:19:22 +0100 Subject: [PATCH] Handle false positive from make. --- MANIFEST | 1 + bin/blhc | 2 ++ t/logs/make | 6 ++++++ t/tests.t | 9 +++++++-- 4 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 t/logs/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 -- 2.43.2