X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;ds=sidebyside;f=t%2Ftests.t;h=1f68cd4a4fea426ef54767201baf10ebaed5d8a5;hb=7bff3a8f927367067116104fb0b6e934e5e0eed3;hp=0641e45241a61834eca143c8a846ee832a2088ea;hpb=affd2ba7dcef980b10553894e0aa40ac1c7dd14e;p=blhc%2Fblhc.git
diff --git a/t/tests.t b/t/tests.t
index 0641e45..1f68cd4 100644
--- a/t/tests.t
+++ b/t/tests.t
@@ -19,7 +19,7 @@
use strict;
use warnings;
-use Test::More tests => 182;
+use Test::More tests => 192;
sub is_blhc {
@@ -38,7 +38,11 @@ sub is_blhc {
$options = ' '. $options;
}
is $? >> 8, $exit, "$file$options (exit code)";
- is $output, $expected, "$file$options (output)";
+ # Perform regex or string match.
+ my $cmd = (ref $expected eq 'Regexp')
+ ? \&like
+ : \&is;
+ &$cmd($output, $expected, "$file$options (output)");
}
@@ -73,6 +77,16 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see .
';
+is_blhc '', '--help', 1,
+ qr/^Usage:
+ blhc \[\*options\*\] \*\.\.\*
+
+Options:
+/s;
+
+is_blhc 'doesnt-exist', '', 2,
+ qr{^No such file or directory at \./bin/blhc line \d+\.$};
+
# No compiler commands found.
@@ -114,6 +128,12 @@ is_blhc 'ignore-flag', '--ignore-arch-flag -g:', 2,
Usage:
blhc [*options*] *..*
+';
+is_blhc 'ignore-flag', '--ignore-arch-flag :amd64', 2,
+ 'Value ":amd64" invalid for option ignore-arch-flag ("arch:flag" expected)
+Usage:
+ blhc [*options*] *..*
+
';
# Wrong architecture.
@@ -171,6 +191,12 @@ is_blhc 'ignore-line', '--ignore-arch-line .+:', 2,
Usage:
blhc [*options*] *..*
+';
+is_blhc 'ignore-line', '--ignore-arch-line :amd64', 2,
+ 'Value ":amd64" invalid for option ignore-arch-line ("arch:line" expected)
+Usage:
+ blhc [*options*] *..*
+
';
# Wrong architecture.
@@ -485,6 +511,12 @@ CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -g -O2 -fstack-protector --param=ssp
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -c test-c.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -fPIC -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -c ../../../../src/test/test.c -o test.so.o
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): g++ -o test -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security test-a.cxx test-b.o test-c.o -Wl,-z,relro
+CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -D_FORTIFY_SOURCE=0 -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -c test-a.c
+CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -D_FORTIFY_SOURCE=1 -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -c test-b.c
+CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=1 -c test-c.c
+CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=0 -c test-d.c
+CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -D_FORTIFY_SOURCE=0 -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-e.c
+CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -D_FORTIFY_SOURCE=1 -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-f.c
';
my $bad_ldflags =
@@ -609,6 +641,11 @@ is_blhc 'make', '', 1,
$empty;
+# qt4
+
+is_blhc 'qt4', '', 1,
+ $empty;
+
# cc