diff -Nru ms-gsl-3.1.0/debian/changelog ms-gsl-3.1.0/debian/changelog --- ms-gsl-3.1.0/debian/changelog 2020-06-06 19:00:01.000000000 +0000 +++ ms-gsl-3.1.0/debian/changelog 2020-08-20 04:42:55.000000000 +0000 @@ -1,3 +1,15 @@ +ms-gsl (3.1.0-2) unstable; urgency=medium + + * New Move-array-bounds-tests.patch (closes: #966895). + - Use independent translation unit to bypass an error caused by + "-Warray-bounds" flag. + * Add autopkgtests with various GCC versions and C++ standards. + * Update DebHelper compatibility level to 13. + - Remove no longer needed the CMAKE_SKIP_INSTALL_ALL_DEPENDENCY variable + from the debian/rules file. + + -- Nicholas Guriev Thu, 20 Aug 2020 07:42:55 +0300 + ms-gsl (3.1.0-1) unstable; urgency=medium * New upstream release. diff -Nru ms-gsl-3.1.0/debian/control ms-gsl-3.1.0/debian/control --- ms-gsl-3.1.0/debian/control 2020-06-06 19:00:01.000000000 +0000 +++ ms-gsl-3.1.0/debian/control 2020-08-20 04:42:55.000000000 +0000 @@ -2,7 +2,7 @@ Section: libdevel Priority: optional Maintainer: Nicholas Guriev -Build-Depends: debhelper-compat (= 12) +Build-Depends: debhelper-compat (= 13) Build-Depends-Indep: cmake (>= 3.14), libgtest-dev , diff -Nru ms-gsl-3.1.0/debian/patches/Move-array-bounds-tests.patch ms-gsl-3.1.0/debian/patches/Move-array-bounds-tests.patch --- ms-gsl-3.1.0/debian/patches/Move-array-bounds-tests.patch 1970-01-01 00:00:00.000000000 +0000 +++ ms-gsl-3.1.0/debian/patches/Move-array-bounds-tests.patch 2020-08-20 04:42:55.000000000 +0000 @@ -0,0 +1,126 @@ +Description: Move tests that trigger -Warray-bounds to separate compilation unit + GCC 10 is now smart enough to detect violation of array boundaries that tests + are actually tested. Along with -Werror this led to tests failure, so I move + such tests to another compilation unit to have the warning deactivated for + only these tests. +Bug-Debian: https://bugs.debian.org/966895 +Author: Nicholas Guriev +Last-Modified: Wed, 19 Aug 2020 08:55:52 +0300 + +--- a/tests/CMakeLists.txt ++++ b/tests/CMakeLists.txt +@@ -179,6 +179,7 @@ add_gsl_test(owner_tests) + add_gsl_test(byte_tests) + add_gsl_test(algorithm_tests) + add_gsl_test(strict_notnull_tests) ++add_gsl_test(array_bounds) + + + # No exception tests +--- /dev/null ++++ b/tests/array_bounds.cpp +@@ -0,0 +1,68 @@ ++/////////////////////////////////////////////////////////////////////////////// ++// ++// Copyright (c) 2015 Microsoft Corporation. All rights reserved. ++// ++// This code is licensed under the MIT License (MIT). ++// ++// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ++// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ++// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ++// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ++// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ++// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN ++// THE SOFTWARE. ++// ++/////////////////////////////////////////////////////////////////////////////// ++ ++#ifdef __GNUC__ ++#pragma GCC diagnostic warning "-Warray-bounds" ++#endif // __GNUC__ ++ ++#include ++ ++#include // for gsl::multi_span ++ ++namespace gsl ++{ ++struct fail_fast; ++} // namespace gsl ++ ++namespace ++{ ++static constexpr char deathstring[] = "Expected Death"; ++} // namespace ++ ++TEST(array_bounds, subspan_from_multi_span_test) ++{ ++ int arr[5] = {1, 2, 3, 4, 5}; ++ gsl::multi_span av = arr; ++ ++ std::set_terminate([] { ++ std::cerr << "Expected Death. subspan"; ++ std::abort(); ++ }); ++ ++ EXPECT_DEATH(av.subspan(6).length(), deathstring); ++} ++ ++TEST(array_bounds, strided_span_bounds_from_strided_span_tests) ++{ ++ int arr[] = {0, 1, 2, 3}; ++ gsl::multi_span av(arr); ++ ++ std::set_terminate([] { ++ std::cerr << "Expected Death. strided_span_bounds"; ++ std::abort(); ++ }); ++ ++ // incorrect sections ++ EXPECT_DEATH(av.section(0, 0)[0], deathstring); ++ EXPECT_DEATH(av.section(1, 0)[0], deathstring); ++ EXPECT_DEATH(av.section(1, 1)[1], deathstring); ++ ++ EXPECT_DEATH(av.section(2, 5), deathstring); ++ EXPECT_DEATH(av.section(5, 2), deathstring); ++ EXPECT_DEATH(av.section(5, 0), deathstring); ++ EXPECT_DEATH(av.section(0, 5), deathstring); ++ EXPECT_DEATH(av.section(5, 5), deathstring); ++} +--- a/tests/multi_span_tests.cpp ++++ b/tests/multi_span_tests.cpp +@@ -1042,10 +1042,6 @@ TEST(multi_span_test, subspan) + EXPECT_TRUE(av.subspan(1).length() == 4); + EXPECT_TRUE(av.subspan(4).length() == 1); + EXPECT_TRUE(av.subspan(5).length() == 0); +- // Disabled test instead of fixing since multi_span is deprecated. (PR#835) +-#if !(defined(__GNUC__) && __GNUC__ == 8) +- EXPECT_DEATH(av.subspan(6).length(), deathstring); +-#endif + auto av2 = av.subspan(1); + for (int i = 0; i < 4; ++i) EXPECT_TRUE(av2[i] == i + 2); + } +--- a/tests/strided_span_tests.cpp ++++ b/tests/strided_span_tests.cpp +@@ -403,20 +403,6 @@ TEST(strided_span_tests, strided_span_bo + }); + + { +- // incorrect sections +- +- EXPECT_DEATH(av.section(0, 0)[0], deathstring); +- EXPECT_DEATH(av.section(1, 0)[0], deathstring); +- EXPECT_DEATH(av.section(1, 1)[1], deathstring); +- +- EXPECT_DEATH(av.section(2, 5), deathstring); +- EXPECT_DEATH(av.section(5, 2), deathstring); +- EXPECT_DEATH(av.section(5, 0), deathstring); +- EXPECT_DEATH(av.section(0, 5), deathstring); +- EXPECT_DEATH(av.section(5, 5), deathstring); +- } +- +- { + // zero stride + strided_span sav{av, {{4}, {}}}; + EXPECT_TRUE(sav[0] == 0); diff -Nru ms-gsl-3.1.0/debian/patches/series ms-gsl-3.1.0/debian/patches/series --- ms-gsl-3.1.0/debian/patches/series 2020-06-06 19:00:01.000000000 +0000 +++ ms-gsl-3.1.0/debian/patches/series 2020-08-20 04:42:55.000000000 +0000 @@ -1,2 +1,3 @@ Preinstalled-GoogleTest.patch Revert-Drop-ARCH_INDEPENDENT.patch +Move-array-bounds-tests.patch diff -Nru ms-gsl-3.1.0/debian/rules ms-gsl-3.1.0/debian/rules --- ms-gsl-3.1.0/debian/rules 2020-03-06 16:49:51.000000000 +0000 +++ ms-gsl-3.1.0/debian/rules 2020-08-20 04:42:55.000000000 +0000 @@ -1,10 +1,8 @@ #!/usr/bin/make -f -EXTRA_CMAKE_VARIABLES += \ - CMAKE_DISABLE_FIND_PACKAGE_Git=ON \ - CMAKE_SKIP_INSTALL_ALL_DEPENDENCY=ON -ifneq (,$(filter nocheck, $(DEB_BUILD_OPTIONS))) - EXTRA_CMAKE_VARIABLES += GSL_TEST=OFF +EXTRA_CMAKE_VARIABLES += CMAKE_DISABLE_FIND_PACKAGE_Git=ON +ifneq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) +EXTRA_CMAKE_VARIABLES += GSL_TEST=OFF endif %: diff -Nru ms-gsl-3.1.0/debian/tests/control ms-gsl-3.1.0/debian/tests/control --- ms-gsl-3.1.0/debian/tests/control 1970-01-01 00:00:00.000000000 +0000 +++ ms-gsl-3.1.0/debian/tests/control 2020-08-20 04:42:55.000000000 +0000 @@ -0,0 +1,11 @@ +Tests: with-gcc8-std14 with-gcc8-std17 +Depends: cmake, g++-8, libgtest-dev, pkg-config +Restrictions: allow-stderr, skip-not-installable + +Tests: with-gcc9-std14 with-gcc9-std17 +Depends: cmake, g++-9, libgtest-dev, pkg-config +Restrictions: allow-stderr, skip-not-installable + +Tests: with-gcc10-std17 with-gcc10-std20 +Depends: cmake, g++-10, libgtest-dev, pkg-config +Restrictions: allow-stderr, skip-not-installable diff -Nru ms-gsl-3.1.0/debian/tests/entry ms-gsl-3.1.0/debian/tests/entry --- ms-gsl-3.1.0/debian/tests/entry 1970-01-01 00:00:00.000000000 +0000 +++ ms-gsl-3.1.0/debian/tests/entry 2020-08-20 04:42:55.000000000 +0000 @@ -0,0 +1,20 @@ +#!/bin/bash +# SPDX-License-Identifier: MIT +# Copyright (c) 2020 Nicholas Guriev +set -e -u + +what=$(basename "$0") +IFS='-' read -r _ compiller cppstd <<< "${what}" +compiller="g++-${compiller#gcc}" +cppstd="${cppstd#std}" +parallel="$(nproc)" + +set -x +cmake -B "${AUTOPKGTEST_TMP}" \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_VERBOSE_MAKEFILE=ON \ + -DCMAKE_DISABLE_FIND_PACKAGE_Git=ON \ + -DCMAKE_CXX_COMPILER="${compiller}" \ + -DGSL_CXX_STANDARD="${cppstd}" +make -C "${AUTOPKGTEST_TMP}" "-j${parallel:-1}" +make -C "${AUTOPKGTEST_TMP}" test "ARGS+=-j${parallel:-1}" diff -Nru ms-gsl-3.1.0/debian/tests/with-gcc10-std17 ms-gsl-3.1.0/debian/tests/with-gcc10-std17 --- ms-gsl-3.1.0/debian/tests/with-gcc10-std17 1970-01-01 00:00:00.000000000 +0000 +++ ms-gsl-3.1.0/debian/tests/with-gcc10-std17 2020-08-20 04:42:55.000000000 +0000 @@ -0,0 +1,20 @@ +#!/bin/bash +# SPDX-License-Identifier: MIT +# Copyright (c) 2020 Nicholas Guriev +set -e -u + +what=$(basename "$0") +IFS='-' read -r _ compiller cppstd <<< "${what}" +compiller="g++-${compiller#gcc}" +cppstd="${cppstd#std}" +parallel="$(nproc)" + +set -x +cmake -B "${AUTOPKGTEST_TMP}" \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_VERBOSE_MAKEFILE=ON \ + -DCMAKE_DISABLE_FIND_PACKAGE_Git=ON \ + -DCMAKE_CXX_COMPILER="${compiller}" \ + -DGSL_CXX_STANDARD="${cppstd}" +make -C "${AUTOPKGTEST_TMP}" "-j${parallel:-1}" +make -C "${AUTOPKGTEST_TMP}" test "ARGS+=-j${parallel:-1}" diff -Nru ms-gsl-3.1.0/debian/tests/with-gcc10-std20 ms-gsl-3.1.0/debian/tests/with-gcc10-std20 --- ms-gsl-3.1.0/debian/tests/with-gcc10-std20 1970-01-01 00:00:00.000000000 +0000 +++ ms-gsl-3.1.0/debian/tests/with-gcc10-std20 2020-08-20 04:42:55.000000000 +0000 @@ -0,0 +1,20 @@ +#!/bin/bash +# SPDX-License-Identifier: MIT +# Copyright (c) 2020 Nicholas Guriev +set -e -u + +what=$(basename "$0") +IFS='-' read -r _ compiller cppstd <<< "${what}" +compiller="g++-${compiller#gcc}" +cppstd="${cppstd#std}" +parallel="$(nproc)" + +set -x +cmake -B "${AUTOPKGTEST_TMP}" \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_VERBOSE_MAKEFILE=ON \ + -DCMAKE_DISABLE_FIND_PACKAGE_Git=ON \ + -DCMAKE_CXX_COMPILER="${compiller}" \ + -DGSL_CXX_STANDARD="${cppstd}" +make -C "${AUTOPKGTEST_TMP}" "-j${parallel:-1}" +make -C "${AUTOPKGTEST_TMP}" test "ARGS+=-j${parallel:-1}" diff -Nru ms-gsl-3.1.0/debian/tests/with-gcc8-std14 ms-gsl-3.1.0/debian/tests/with-gcc8-std14 --- ms-gsl-3.1.0/debian/tests/with-gcc8-std14 1970-01-01 00:00:00.000000000 +0000 +++ ms-gsl-3.1.0/debian/tests/with-gcc8-std14 2020-08-20 04:42:55.000000000 +0000 @@ -0,0 +1,20 @@ +#!/bin/bash +# SPDX-License-Identifier: MIT +# Copyright (c) 2020 Nicholas Guriev +set -e -u + +what=$(basename "$0") +IFS='-' read -r _ compiller cppstd <<< "${what}" +compiller="g++-${compiller#gcc}" +cppstd="${cppstd#std}" +parallel="$(nproc)" + +set -x +cmake -B "${AUTOPKGTEST_TMP}" \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_VERBOSE_MAKEFILE=ON \ + -DCMAKE_DISABLE_FIND_PACKAGE_Git=ON \ + -DCMAKE_CXX_COMPILER="${compiller}" \ + -DGSL_CXX_STANDARD="${cppstd}" +make -C "${AUTOPKGTEST_TMP}" "-j${parallel:-1}" +make -C "${AUTOPKGTEST_TMP}" test "ARGS+=-j${parallel:-1}" diff -Nru ms-gsl-3.1.0/debian/tests/with-gcc8-std17 ms-gsl-3.1.0/debian/tests/with-gcc8-std17 --- ms-gsl-3.1.0/debian/tests/with-gcc8-std17 1970-01-01 00:00:00.000000000 +0000 +++ ms-gsl-3.1.0/debian/tests/with-gcc8-std17 2020-08-20 04:42:55.000000000 +0000 @@ -0,0 +1,20 @@ +#!/bin/bash +# SPDX-License-Identifier: MIT +# Copyright (c) 2020 Nicholas Guriev +set -e -u + +what=$(basename "$0") +IFS='-' read -r _ compiller cppstd <<< "${what}" +compiller="g++-${compiller#gcc}" +cppstd="${cppstd#std}" +parallel="$(nproc)" + +set -x +cmake -B "${AUTOPKGTEST_TMP}" \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_VERBOSE_MAKEFILE=ON \ + -DCMAKE_DISABLE_FIND_PACKAGE_Git=ON \ + -DCMAKE_CXX_COMPILER="${compiller}" \ + -DGSL_CXX_STANDARD="${cppstd}" +make -C "${AUTOPKGTEST_TMP}" "-j${parallel:-1}" +make -C "${AUTOPKGTEST_TMP}" test "ARGS+=-j${parallel:-1}" diff -Nru ms-gsl-3.1.0/debian/tests/with-gcc9-std14 ms-gsl-3.1.0/debian/tests/with-gcc9-std14 --- ms-gsl-3.1.0/debian/tests/with-gcc9-std14 1970-01-01 00:00:00.000000000 +0000 +++ ms-gsl-3.1.0/debian/tests/with-gcc9-std14 2020-08-20 04:42:55.000000000 +0000 @@ -0,0 +1,20 @@ +#!/bin/bash +# SPDX-License-Identifier: MIT +# Copyright (c) 2020 Nicholas Guriev +set -e -u + +what=$(basename "$0") +IFS='-' read -r _ compiller cppstd <<< "${what}" +compiller="g++-${compiller#gcc}" +cppstd="${cppstd#std}" +parallel="$(nproc)" + +set -x +cmake -B "${AUTOPKGTEST_TMP}" \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_VERBOSE_MAKEFILE=ON \ + -DCMAKE_DISABLE_FIND_PACKAGE_Git=ON \ + -DCMAKE_CXX_COMPILER="${compiller}" \ + -DGSL_CXX_STANDARD="${cppstd}" +make -C "${AUTOPKGTEST_TMP}" "-j${parallel:-1}" +make -C "${AUTOPKGTEST_TMP}" test "ARGS+=-j${parallel:-1}" diff -Nru ms-gsl-3.1.0/debian/tests/with-gcc9-std17 ms-gsl-3.1.0/debian/tests/with-gcc9-std17 --- ms-gsl-3.1.0/debian/tests/with-gcc9-std17 1970-01-01 00:00:00.000000000 +0000 +++ ms-gsl-3.1.0/debian/tests/with-gcc9-std17 2020-08-20 04:42:55.000000000 +0000 @@ -0,0 +1,20 @@ +#!/bin/bash +# SPDX-License-Identifier: MIT +# Copyright (c) 2020 Nicholas Guriev +set -e -u + +what=$(basename "$0") +IFS='-' read -r _ compiller cppstd <<< "${what}" +compiller="g++-${compiller#gcc}" +cppstd="${cppstd#std}" +parallel="$(nproc)" + +set -x +cmake -B "${AUTOPKGTEST_TMP}" \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_VERBOSE_MAKEFILE=ON \ + -DCMAKE_DISABLE_FIND_PACKAGE_Git=ON \ + -DCMAKE_CXX_COMPILER="${compiller}" \ + -DGSL_CXX_STANDARD="${cppstd}" +make -C "${AUTOPKGTEST_TMP}" "-j${parallel:-1}" +make -C "${AUTOPKGTEST_TMP}" test "ARGS+=-j${parallel:-1}"