From f593354f68feceea096b52a371be2ba76a8f785f Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Fri, 11 May 2012 17:18:06 +0200 Subject: [PATCH] Ignore false positives from moc-qt4. --- MANIFEST | 1 + bin/blhc | 7 +++++++ t/logs/qt4 | 8 ++++++++ t/tests.t | 7 ++++++- 4 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 t/logs/qt4 diff --git a/MANIFEST b/MANIFEST index 91fcec6..1ef6dac 100644 --- a/MANIFEST +++ b/MANIFEST @@ -45,5 +45,6 @@ t/logs/ignore-flag-ldflags t/logs/ignore-line t/logs/libtool t/logs/make +t/logs/qt4 t/logs/verbose-build t/tests.t diff --git a/bin/blhc b/bin/blhc index d2a4cc3..94ceb6f 100755 --- a/bin/blhc +++ b/bin/blhc @@ -744,6 +744,13 @@ foreach my $file (@ARGV) { [Cc]ompiler[\s.]*:?\s+ /xo; next if $line =~ /^\s*(?:- )?(?:HOST_)?(?:CC|CXX)\s*=\s*$cc_regex_full\s*$/o; + # `moc-qt4`, contains '-I/usr/share/qt4/mkspecs/linux-g++' (or + # similar for other architectures) which gets recognized as a + # compiler line. Ignore it. + next if $line =~ m{^/usr/bin/moc-qt4 + \s.+\s + -I/usr/share/qt4/mkspecs/[a-z]+-g\++(?:-64)? + \s}x; # Check if additional hardening options were used. Used to ensure # they are used for the complete build. diff --git a/t/logs/qt4 b/t/logs/qt4 new file mode 100644 index 0000000..c707639 --- /dev/null +++ b/t/logs/qt4 @@ -0,0 +1,8 @@ +dpkg-buildpackage: source package test + +# Output by qt4 which should be ignored. + +/usr/bin/moc-qt4 -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtNetwork -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I/usr/include/qt4/QtDBus -I/include -I.. -I. -I. test.h -o moc_test.cpp + +/usr/bin/moc-qt4 -DQT_NO_DEBUG_OUTPUT -DAPP_VERSION=1.1 -DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS -DQT_NO_DEBUG -DQT_PHONON_LIB -DQT_DBUS_LIB -DQT_SQL_LIB -DQT_XML_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/glibc-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtNetwork -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtXml -I/usr/include/qt4/QtSql -I/usr/include/qt4/QtDBus -I/usr/include/qt4 -Ilocale -Ibuild/moc -o build/moc/moc_test.cpp +/usr/bin/moc-qt4 -DQT_NO_DEBUG_OUTPUT -DAPP_VERSION=1.1 -DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS -DQT_NO_DEBUG -DQT_PHONON_LIB -DQT_DBUS_LIB -DQT_SQL_LIB -DQT_XML_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++-64 -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtNetwork -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtXml -I/usr/include/qt4/QtSql -I/usr/include/qt4/QtDBus -I/usr/include/qt4 -Ilocale -Ibuild/moc -o build/moc/moc_test.cpp diff --git a/t/tests.t b/t/tests.t index d41fad9..1248396 100644 --- a/t/tests.t +++ b/t/tests.t @@ -19,7 +19,7 @@ use strict; use warnings; -use Test::More tests => 190; +use Test::More tests => 192; sub is_blhc { @@ -635,6 +635,11 @@ is_blhc 'make', '', 1, $empty; +# qt4 + +is_blhc 'qt4', '', 1, + $empty; + # cc -- 2.45.2