]> ruderich.org/simon Gitweb - blhc/blhc.git/blobdiff - t/tests.t
Use I<> for arguments in POD.
[blhc/blhc.git] / t / tests.t
index e3acca2da9ea3dcc4aae1e8f49af075fd11c0fcd..9bdab495bc6aa87f8017667ab20d4b6b51212555 100644 (file)
--- a/t/tests.t
+++ b/t/tests.t
@@ -19,7 +19,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 98;
+use Test::More tests => 100;
 
 
 sub is_blhc {
@@ -46,16 +46,7 @@ sub is_blhc {
 is_blhc 'empty', '--invalid', 2,
         'Unknown option: invalid
 Usage:
-    blhc [options] <dpkg-buildpackage build log file>..
-
-        --all                   force +all (+pie, +bindnow) check
-        --arch                  set architecture (autodetected)
-        --bindnow               force +bindbow check
-        --buildd                parser mode for buildds
-        --color                 use colored output
-        --pie                   force +pie check
-        --help                  available options
-        --version               version number and license
+    blhc [*options*] *<dpkg-buildpackage build log file>..*
 
 ';
 
@@ -227,6 +218,8 @@ CFLAGS missing (-Wformat): gcc -fPIC -g -O2 -fstack-protector --param=ssp-buffer
 CFLAGS missing (-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security): gcc test.c -o test.output
 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc test.c -o test.output
 LDFLAGS missing (-Wl,-z,relro): gcc test.c -o test.output
+CFLAGS missing (-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security): (gcc -Wl,-z,relro -o test.output test.c)
+CPPFLAGS missing (-D_FORTIFY_SOURCE=2): (gcc -Wl,-z,relro -o test.output test.c)
 ';
 is_blhc 'bad-cflags', '--pie', 8,
         'CFLAGS missing (-fPIE -Wformat): gcc -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-a.c
@@ -242,6 +235,9 @@ CFLAGS missing (-Wformat): gcc -fPIC -g -O2 -fstack-protector --param=ssp-buffer
 CFLAGS missing (-g -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security): gcc test.c -o test.output
 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc test.c -o test.output
 LDFLAGS missing (-fPIE -pie -Wl,-z,relro): gcc test.c -o test.output
+CFLAGS missing (-g -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security): (gcc -Wl,-z,relro -o test.output test.c)
+CPPFLAGS missing (-D_FORTIFY_SOURCE=2): (gcc -Wl,-z,relro -o test.output test.c)
+LDFLAGS missing (-fPIE -pie): (gcc -Wl,-z,relro -o test.output test.c)
 ';
 is_blhc 'bad-cflags', '--bindnow', 8,
         'CFLAGS missing (-Wformat): gcc -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-a.c
@@ -258,6 +254,9 @@ CFLAGS missing (-Wformat): gcc -fPIC -g -O2 -fstack-protector --param=ssp-buffer
 CFLAGS missing (-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security): gcc test.c -o test.output
 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc test.c -o test.output
 LDFLAGS missing (-Wl,-z,relro -Wl,-z,now): gcc test.c -o test.output
+CFLAGS missing (-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security): (gcc -Wl,-z,relro -o test.output test.c)
+CPPFLAGS missing (-D_FORTIFY_SOURCE=2): (gcc -Wl,-z,relro -o test.output test.c)
+LDFLAGS missing (-Wl,-z,now): (gcc -Wl,-z,relro -o test.output test.c)
 ';
 is_blhc 'bad-cflags', '--pie --bindnow', 8,
         'CFLAGS missing (-fPIE -Wformat): gcc -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-a.c
@@ -274,6 +273,9 @@ CFLAGS missing (-Wformat): gcc -fPIC -g -O2 -fstack-protector --param=ssp-buffer
 CFLAGS missing (-g -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security): gcc test.c -o test.output
 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc test.c -o test.output
 LDFLAGS missing (-fPIE -pie -Wl,-z,relro -Wl,-z,now): gcc test.c -o test.output
+CFLAGS missing (-g -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security): (gcc -Wl,-z,relro -o test.output test.c)
+CPPFLAGS missing (-D_FORTIFY_SOURCE=2): (gcc -Wl,-z,relro -o test.output test.c)
+LDFLAGS missing (-fPIE -pie -Wl,-z,now): (gcc -Wl,-z,relro -o test.output test.c)
 ';
 
 is_blhc 'bad-cppflags', '', 8,
@@ -575,28 +577,18 @@ is_blhc 'buildd-package-details', '--buildd', 0,
         '';
 
 is_blhc 'buildd-dpkg-dev', '--buildd', 8,
-        'CFLAGS missing (-fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security): gcc -g -O2 -c test-a.c
-CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -g -O2 -c test-a.c
-CFLAGS missing (-fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security): gcc -g -O2 -c test-b.c
-CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -g -O2 -c test-b.c
-CFLAGS missing (-fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security): gcc -g -O2 -c test-c.c
-CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -g -O2 -c test-c.c
-LDFLAGS missing (-Wl,-z,relro): gcc -o test test-a.o test-b.o test-c.o -ltest
-CFLAGS missing (-O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security): gcc -g -c test-a.c
-CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -g -c test-a.c
-CFLAGS missing (-O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security): gcc -g -c test-b.c
-CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -g -c test-b.c
-CFLAGS missing (-O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security): gcc -g -c test-c.c
-CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -g -c test-c.c
-LDFLAGS missing (-Wl,-z,relro): gcc -o test test-a.o test-b.o test-c.o -ltest
+        'W-dpkg-buildflags-missing CPPFLAGS 7 (of 7), CFLAGS 6 (of 6), CXXFLAGS 1 (of 1), LDFLAGS 2 (of 2) missing
 ';
 
 is_blhc 'buildd-dpkg-dev-old', '--buildd', 8,
-        'CFLAGS missing (-O2): gcc -g -c test-a.c
-CFLAGS missing (-O2): gcc -g -c test-b.c
-CFLAGS missing (-O2): gcc -g -c test-c.c
+        'W-dpkg-buildflags-missing CFLAGS 3 (of 6), CXXFLAGS 1 (of 1) missing
 ';
 
+is_blhc 'buildd-verbose-build', '--buildd', 4,
+        'W-compiler-flags-hidden 1 (of 5) hidden
+';
+
+
 # multiple files
 
 is_blhc ['good', 'good-pie', 'good-bindnow', 'good-all', 'good-multiline', 'good-library'], '', 0,