]> ruderich.org/simon Gitweb - blhc/blhc.git/commitdiff
Ignore false positives from moc-qt4.
authorSimon Ruderich <simon@ruderich.org>
Fri, 11 May 2012 15:18:06 +0000 (17:18 +0200)
committerSimon Ruderich <simon@ruderich.org>
Fri, 11 May 2012 15:18:06 +0000 (17:18 +0200)
MANIFEST
bin/blhc
t/logs/qt4 [new file with mode: 0644]
t/tests.t

index 91fcec6fb7bd3c3bfae9f94abcf42f01d251693b..1ef6dac86bed0663b857f11fbc692c4789c4c065 100644 (file)
--- 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
index d2a4cc31c2cd1b72eb8153eaf68cf13ac36d4e5d..94ceb6f01f806ee64db5f6878dcb163e39508214 100755 (executable)
--- 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 (file)
index 0000000..c707639
--- /dev/null
@@ -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
index d41fad9bc9410dd3e77407df9174c037ba46fc8e..1248396a8374ff07497f4a5e4ed24c4675db6ebc 100644 (file)
--- 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