Преглед на файлове

scripts/t: Get the reference build flags from dpkg-buildflags.pl

The build flags might change depending on the architecture, so instead of
hardcoding them, retrieve them from the source's tree dpkg-buildflags.pl.

Closes: #794694
Guillem Jover преди 11 години
родител
ревизия
bec92eed80
променени са 3 файла, в които са добавени 17 реда и са изтрити 9 реда
  1. 4 0
      debian/changelog
  2. 4 0
      scripts/t/mk.t
  3. 9 9
      scripts/t/mk/buildflags.mk

+ 4 - 0
debian/changelog

@@ -5,6 +5,10 @@ dpkg (1.18.3) UNRELEASED; urgency=low
     - Only warn on invalid week days instead of aborting in
       Dpkg::Changelog::Entry::Debian. Regression introduced in dpkg 1.18.2.
       Reported by Jakub Wilk <jwilk@debian.org>.
+  * Test suite:
+    - Get the reference build flags from dpkg-buildflags.pl, instead of
+      hardcoding them, which might not match depending on the architecture.
+      Closes: #794694
 
   [ Updated programs translations ]
   * Catalan (Jordi Mallach).

+ 4 - 0
scripts/t/mk.t

@@ -66,6 +66,10 @@ test_makefile('architecture.mk');
 $ENV{$_} = $arch{$_} foreach keys %arch;
 test_makefile('architecture.mk');
 
+my %buildflag = cmd_get_vars("$srcdir/dpkg-buildflags.pl");
+
+delete $ENV{$_} foreach keys %buildflag;
+$ENV{"TEST_$_"} = $buildflag{$_} foreach keys %buildflag;
 test_makefile('buildflags.mk');
 
 test_makefile('pkg-info.mk');

+ 9 - 9
scripts/t/mk/buildflags.mk

@@ -3,12 +3,12 @@ DEB_CPPFLAGS_MAINT_APPEND = -DTEST_MK=test
 include $(srcdir)/mk/buildflags.mk
 
 test:
-	test "$(CFLAGS)" = "-g -O2 -fstack-protector-strong -Wformat -Werror=format-security"
-	test "$(CPPFLAGS)" = "-D_FORTIFY_SOURCE=2 -DTEST_MK=test"
-	test "$(CXXFLAGS)" = "-g -O2 -fstack-protector-strong -Wformat -Werror=format-security"
-	test "$(FCFLAGS)" = "-g -O2 -fstack-protector-strong"
-	test "$(FFLAGS)" = "-g -O2 -fstack-protector-strong"
-	test "$(GCJFLAGS)" = "-g -O2 -fstack-protector-strong"
-	test "$(LDFLAGS)" = "-Wl,-z,relro"
-	test "$(OBJCFLAGS)" = "-g -O2 -fstack-protector-strong -Wformat -Werror=format-security"
-	test "$(OBJCXXFLAGS)" = "-g -O2 -fstack-protector-strong -Wformat -Werror=format-security"
+	test "$(CFLAGS)" = "$(TEST_CFLAGS)"
+	test "$(CPPFLAGS)" = "$(TEST_CPPFLAGS) -DTEST_MK=test"
+	test "$(CXXFLAGS)" = "$(TEST_CXXFLAGS)"
+	test "$(FCFLAGS)" = "$(TEST_FCFLAGS)"
+	test "$(FFLAGS)" = "$(TEST_FFLAGS)"
+	test "$(GCJFLAGS)" = "$(TEST_GCJFLAGS)"
+	test "$(LDFLAGS)" = "$(TEST_LDFLAGS)"
+	test "$(OBJCFLAGS)" = "$(TEST_OBJCFLAGS)"
+	test "$(OBJCXXFLAGS)" = "$(TEST_OBJCXXFLAGS)"