X-Git-Url: https://ruderich.org/simon/gitweb/?p=blhc%2Fblhc.git;a=blobdiff_plain;f=t%2Ftests.t;h=e238b1ad58aa188ec45cc51ef02c487f82b821ff;hp=d9c15c311f23ee4dfb0c61682e9385293eced2e9;hb=a98be1bc5f253c876681cb133896d72d527fff1c;hpb=fd2822367ae3c4bcc451d2f82e4b1cee87a741d6 diff --git a/t/tests.t b/t/tests.t index d9c15c3..e238b1a 100644 --- 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,