]> ruderich.org/simon Gitweb - blhc/blhc.git/blobdiff - t/tests.t
Add --ignore-flag and --ignore-line options.
[blhc/blhc.git] / t / tests.t
index d9c15c311f23ee4dfb0c61682e9385293eced2e9..e238b1ad58aa188ec45cc51ef02c487f82b821ff 100644 (file)
--- a/t/tests.t
+++ b/t/tests.t
@@ -19,7 +19,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 122;
+use Test::More tests => 130;
 
 
 sub is_blhc {
@@ -71,6 +71,28 @@ is_blhc 'arch-avr32', '--color', 8,
 ";
 
 
+# Ignore missing compiler flags.
+
+is_blhc 'ignore-flag', '--ignore-flag -g', 8,
+        'CFLAGS missing (-O2): gcc -g     -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-c.c
+';
+
+is_blhc 'ignore-flag', '--ignore-flag -g --ignore-flag -O2', 0,
+        '';
+
+
+# Ignore certain lines.
+
+is_blhc 'ignore-line', '--ignore-line "\./prepare-script gcc test-[a-z]\.c"', 8,
+        'CFLAGS missing (-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security):     ./prepare-script gcc test-a.c test-b.c test-c.c
+CPPFLAGS missing (-D_FORTIFY_SOURCE=2):     ./prepare-script gcc test-a.c test-b.c test-c.c
+LDFLAGS missing (-Wl,-z,relro):     ./prepare-script gcc test-a.c test-b.c test-c.c
+';
+
+is_blhc 'ignore-line', '--ignore-line "\./prepare-script gcc test-[a-z]\.c" --ignore-line "\s*\./prepare-script gcc test-[a-z]\.c .+"', 0,
+        '';
+
+
 # Correct build logs.
 
 is_blhc 'good', '', 0,