X-Git-Url: https://ruderich.org/simon/gitweb/?p=blhc%2Fblhc.git;a=blobdiff_plain;f=t%2Ftests.t;h=0811ef7bd8643157f7bf90726371cec1e66bdf54;hp=7b88c910329c3fdc4eef04e4b107994c1fcb835d;hb=ae5da64f4f6f53ca3eb055d2124988847b2e8d50;hpb=d8241af33b38ea15eee60caebba0f931c80061be diff --git a/t/tests.t b/t/tests.t index 7b88c91..0811ef7 100644 --- a/t/tests.t +++ b/t/tests.t @@ -61,7 +61,7 @@ is_blhc '', '', 2, $usage; is_blhc '', '--version', 0, - 'blhc 0.02 Copyright (C) 2012 Simon Ruderich + 'blhc 0.03 Copyright (C) 2012 Simon Ruderich This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -85,7 +85,7 @@ Options: /s; is_blhc 'doesnt-exist', '', 2, - qr{^No such file or directory at \./bin/blhc line \d+\.$}; + qr{^No such file: \./t/logs/doesnt-exist at \./bin/blhc line \d+\.$}; # No compiler commands found. @@ -527,6 +527,8 @@ is_blhc 'bad-cppflags', '--ignore-flag -D_FORTIFY_SOURCE=2', 0, my $bad_ldflags = 'LDFLAGS missing (-Wl,-z,relro): gcc -o test test-a.o test-b.o test-c.o -ltest +LDFLAGS missing (-Wl,-z,relro): gcc -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -o test test-a.o test-b.o test-c.o +LDFLAGS missing (-Wl,-z,relro): gcc -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -o test test-a.o test-b.o test-c.o test.h '; is_blhc 'bad-ldflags', '', 8, $bad_ldflags; @@ -535,15 +537,21 @@ is_blhc 'bad-ldflags', '--pie', 8, CFLAGS missing (-fPIE): gcc -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-b.c CFLAGS missing (-fPIE): gcc -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-c.c LDFLAGS missing (-fPIE -pie -Wl,-z,relro): gcc -o test test-a.o test-b.o test-c.o -ltest +LDFLAGS missing (-fPIE -pie -Wl,-z,relro): gcc -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -o test test-a.o test-b.o test-c.o +LDFLAGS missing (-fPIE -pie -Wl,-z,relro): gcc -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -o test test-a.o test-b.o test-c.o test.h '; is_blhc 'bad-ldflags', '--bindnow', 8, 'LDFLAGS missing (-Wl,-z,relro -Wl,-z,now): gcc -o test test-a.o test-b.o test-c.o -ltest +LDFLAGS missing (-Wl,-z,relro -Wl,-z,now): gcc -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -o test test-a.o test-b.o test-c.o +LDFLAGS missing (-Wl,-z,relro -Wl,-z,now): gcc -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -o test test-a.o test-b.o test-c.o test.h '; is_blhc 'bad-ldflags', '--pie --bindnow', 8, 'CFLAGS missing (-fPIE): gcc -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-a.c CFLAGS missing (-fPIE): gcc -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-b.c CFLAGS missing (-fPIE): gcc -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-c.c LDFLAGS missing (-fPIE -pie -Wl,-z,relro -Wl,-z,now): gcc -o test test-a.o test-b.o test-c.o -ltest +LDFLAGS missing (-fPIE -pie -Wl,-z,relro -Wl,-z,now): gcc -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -o test test-a.o test-b.o test-c.o +LDFLAGS missing (-fPIE -pie -Wl,-z,relro -Wl,-z,now): gcc -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -o test test-a.o test-b.o test-c.o test.h '; is_blhc 'bad-multiline', '', 8, @@ -764,6 +772,10 @@ LDFLAGS missing (-fPIE -pie -Wl,-z,now): gcc -g -O2 -fstack-protector --param=ss CFLAGS missing (-g -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security): /bin/bash ../libtool --tag=CC --mode=link gcc -Wl,-z,relro -o test.so test.c CPPFLAGS missing (-D_FORTIFY_SOURCE=2): /bin/bash ../libtool --tag=CC --mode=link gcc -Wl,-z,relro -o test.so test.c LDFLAGS missing (-fPIE -pie -Wl,-z,now): /bin/bash ../libtool --tag=CC --mode=link gcc -Wl,-z,relro -o test.so test.c +CPPFLAGS missing (-D_FORTIFY_SOURCE=2): /bin/sh ../libtool --mode=link gcc -Wl,-z,relro -o libtest.la test.h test-a.lo test-b.lo test-c.lo test-d.la +LDFLAGS missing (-fPIE -pie -Wl,-z,now): /bin/sh ../libtool --mode=link gcc -Wl,-z,relro -o libtest.la test.h test-a.lo test-b.lo test-c.lo test-d.la +CPPFLAGS missing (-D_FORTIFY_SOURCE=2): /bin/sh ../libtool --mode=link gcc -o libtest.la test.h test-a.lo test-b.lo test-c.lo test-d.la +LDFLAGS missing (-fPIE -pie -Wl,-z,relro -Wl,-z,now): /bin/sh ../libtool --mode=link gcc -o libtest.la test.h test-a.lo test-b.lo test-c.lo test-d.la '; @@ -856,39 +868,39 @@ is_blhc 'false-positives', '', 1, # buildd support -is_blhc 'empty', '--buildd', 1, - 'I-no-compiler-commands +is_blhc 'empty', '--buildd', 0, + 'I-no-compiler-commands|| '; is_blhc 'buildd-package-details', '--buildd', 0, ''; -is_blhc 'buildd-dpkg-dev', '--buildd', 8, - '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', '--buildd', 0, + '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, - 'W-dpkg-buildflags-missing CFLAGS 3 (of 6), CXXFLAGS 1 (of 1) missing +is_blhc 'buildd-dpkg-dev-old', '--buildd', 0, + 'W-dpkg-buildflags-missing|CFLAGS 3 (of 6), CXXFLAGS 1 (of 1) missing| '; -is_blhc 'buildd-dpkg-dev-missing', '--buildd', 8, - 'W-dpkg-buildflags-missing CFLAGS 3 (of 6), CXXFLAGS 1 (of 1) missing +is_blhc 'buildd-dpkg-dev-missing', '--buildd', 0, + 'W-dpkg-buildflags-missing|CFLAGS 3 (of 6), CXXFLAGS 1 (of 1) missing| '; -is_blhc 'debian-hardening-wrapper', '--buildd', 16, - 'I-hardening-wrapper-used +is_blhc 'debian-hardening-wrapper', '--buildd', 0, + 'I-hardening-wrapper-used|| '; -is_blhc 'buildd-verbose-build', '--buildd', 4, - 'W-compiler-flags-hidden 1 (of 5) hidden +is_blhc 'buildd-verbose-build', '--buildd', 0, + 'W-compiler-flags-hidden|1 (of 5) hidden| '; -is_blhc 'make', '--buildd', 1, - 'I-no-compiler-commands +is_blhc 'make', '--buildd', 0, + 'I-no-compiler-commands|| '; -is_blhc 'debian-cmake', '--buildd', 32, - 'I-invalid-cmake-used 2.8.7-1 +is_blhc 'debian-cmake', '--buildd', 0, + 'I-invalid-cmake-used|2.8.7-1| ';