From d6333e474554290abc21a27bbd1de7e0be1a4e10 Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Wed, 11 Apr 2012 13:40:24 +0200 Subject: [PATCH] Don't recognize options which contain compiler names as compiler lines. For example "-c++". --- MANIFEST | 1 + bin/blhc | 1 + t/logs/false-positives | 5 +++++ t/tests.t | 14 +++++++++----- 4 files changed, 16 insertions(+), 5 deletions(-) create mode 100644 t/logs/false-positives diff --git a/MANIFEST b/MANIFEST index 4df8ddb..c714bdc 100644 --- a/MANIFEST +++ b/MANIFEST @@ -28,6 +28,7 @@ t/logs/debian-cmake-2 t/logs/debian-cmake-ok t/logs/debian-hardening-wrapper t/logs/empty +t/logs/false-positives t/logs/g++ t/logs/gcc t/logs/good diff --git a/bin/blhc b/bin/blhc index 4682d9b..1d35e0b 100755 --- a/bin/blhc +++ b/bin/blhc @@ -31,6 +31,7 @@ our $VERSION = '0.01'; # Regex to catch compiler commands. my $cc_regex = qr/ + (? 130; +use Test::More tests => 132; sub is_blhc { @@ -475,12 +475,10 @@ CFLAGS missing (-Werror=format-security): cd /tmp/test/src && /usr/bin/gcc -g -O # configure/make is_blhc 'configure', '', 1, - 'No compiler commands! -'; + $empty; is_blhc 'make', '', 1, - 'No compiler commands! -'; + $empty; @@ -660,6 +658,12 @@ is_blhc 'debian-hardening-wrapper', '', 16, $debian_hardening_wrapper; +# false positives + +is_blhc 'false-positives', '', 1, + $empty; + + # buildd support is_blhc 'empty', '--buildd', 1, -- 2.43.2