]> ruderich.org/simon Gitweb - blhc/blhc.git/blobdiff - t/tests.t
Add --debian to handle PIE flags like buildd mode
[blhc/blhc.git] / t / tests.t
index 8050601516ae9e7b6ad49b992ef99bf512631988..1ed4dd347d61da6a60c241ae649ca4eeb5f2d25e 100644 (file)
--- a/t/tests.t
+++ b/t/tests.t
@@ -1,6 +1,6 @@
 # Tests for blhc.
 #
-# Copyright (C) 2012-2016  Simon Ruderich
+# Copyright (C) 2012-2017  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
@@ -19,7 +19,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 216;
+use Test::More tests => 228;
 
 
 sub is_blhc {
@@ -67,7 +67,7 @@ is_blhc '', '', 2,
         $usage;
 
 is_blhc '', '--version', 0,
-        'blhc 0.06  Copyright (C) 2012-2016  Simon Ruderich
+        'blhc 0.07  Copyright (C) 2012-2017  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
@@ -751,11 +751,13 @@ LDFLAGS missing (-fPIE -pie -Wl,-z,relro -Wl,-z,now): g++-4.6 -Wl,-z,defs -o tes
 
 my $ada = 'CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc-4.6 -c -fPIC -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security test.c
 LDFLAGS missing (-Wl,-z,relro): /usr/bin/gcc-4.6 -shared -lgnat-4.6 -o libtest.so.2 test-a.o test-b.o test-c.o -Wl,--as-needed
-CFLAGS missing (-fstack-protector-strong -Wformat -Werror=format-security): gcc -c -g -O2 test.c
+CFLAGS missing (-fPIE -fstack-protector-strong -Wformat -Werror=format-security): gcc -c -g -O2 test.c
 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -c -g -O2 test.c
-CFLAGS missing (-fstack-protector-strong -Wformat -Werror=format-security): gcc -g -O2 test.c
+CFLAGS missing (-fPIE -fstack-protector-strong -Wformat -Werror=format-security): gcc -g -O2 test.c
 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -g -O2 test.c
-LDFLAGS missing (-Wl,-z,relro): gcc -g -O2 test.c
+LDFLAGS missing (-fPIE -pie -Wl,-z,relro): gcc -g -O2 test.c
+CFLAGS missing (-fstack-protector-strong): gcc-6 -c -I./ -I../progs -g -O2 -fPIE -gnat2005 -gnato -gnatVa -fstack-check -gnatw.I -I- -o /«PKGBUILDDIR»/build/objects/arm_frm.o /«PKGBUILDDIR»/progs/arm_frm.adb
+CFLAGS missing (-fstack-protector-strong): gcc-6 -c -I./ -I../progs -g -O2 -fPIE -gnat2005 -gnato -gnatVa -fstack-check -I- -x ada -o /«PKGBUILDDIR»/build/objects/arm_form.o /«PKGBUILDDIR»/progs/arm_form.ada
 ';
 is_blhc 'ada', '', 8,
         $ada;
@@ -763,6 +765,19 @@ is_blhc 'ada-pbuilder', '', 8,
         $ada;
 
 
+# fortran
+
+is_blhc 'fortran', '', 8,
+        'CFLAGS missing (-fstack-protector-strong): gfortran -g -w -O2 -Wtabs -ffixed-line-length-132 -Wl,-z,relro -o balls balls.f
+CFLAGS missing (-fstack-protector-strong): gfortran -g -w -O2 -Wtabs -ffixed-line-length-132  -c -o quadric.o quadric.f
+CFLAGS missing (-fstack-protector-strong): gfortran -g -w -O2 -Wtabs -ffixed-line-length-132  -c -o suv.o suv.f
+CFLAGS missing (-fstack-protector-strong): gfortran -g -w -O2 -Wtabs -ffixed-line-length-132 \ rastep.f quadric.o suv.o -Wl,-z,relro \ -o rastep
+CFLAGS missing (-fstack-protector-strong): gfortran -g -w -O2 -Wtabs -ffixed-line-length-132  -c -o render.o render.f
+LDFLAGS missing (-Wl,-z,relro): gfortran -g -w -O2 -Wtabs -ffixed-line-length-132 -fstack-protector-strong -o balls-without-ldflags balls.f
+CFLAGS missing (-fstack-protector-strong): mpifort -cpp -DDOUB -g -O2 -fdebug-prefix-map=/«PKGBUILDDIR»=. -c -o transform.o transform.f90
+';
+
+
 # libtool
 
 is_blhc 'libtool', '--bindnow', 12,
@@ -916,6 +931,15 @@ is_blhc 'buildd-dpkg-dev-missing', '--buildd', 0,
         'W-dpkg-buildflags-missing|CFLAGS 3 (of 6), CXXFLAGS 1 (of 1) missing|
 ';
 
+is_blhc 'buildd-gcc-pie', '--buildd --all', 0,
+        'W-dpkg-buildflags-missing|CFLAGS 1 (of 1), LDFLAGS 1 (of 1) missing|
+';
+is_blhc 'buildd-gcc-pie-builtin-wrong-arch', '--buildd --all', 0,
+        'W-dpkg-buildflags-missing|CFLAGS 1 (of 1), LDFLAGS 1 (of 1) missing|
+';
+is_blhc 'buildd-gcc-pie-builtin', '--buildd', 0, '';
+is_blhc 'buildd-gcc-pie-builtin', '--buildd --all', 0, '';
+
 # Older dpkg versions use -fstack-protector instead of -strong.
 is_blhc 'buildd-dpkg-fstack-protector', '--buildd', 0,
         '';
@@ -943,6 +967,11 @@ is_blhc 'debian-cmake', '--buildd', 0,
 ';
 
 
+# debian specific settings
+
+is_blhc 'debian-gcc-pie', '--debian', 0, '';
+
+
 # multiple files
 
 is_blhc ['good', 'good-pie', 'good-bindnow', 'good-all', 'good-multiline', 'good-library'], '', 0,