diff --git a/0001-tests-Fix-reporting-of-test-failures.patch b/0001-tests-Fix-reporting-of-test-failures.patch new file mode 100644 index 0000000000000000000000000000000000000000..76889b819fcd134df0ed947488519745c07df21f --- /dev/null +++ b/0001-tests-Fix-reporting-of-test-failures.patch @@ -0,0 +1,57 @@ +From ce80a8045c70db57084008a3fd98a7f0ba79544e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?H=C3=A5vard=20F=2E=20Aasen?= +Date: Tue, 27 Sep 2022 20:14:08 +0200 +Subject: [PATCH] tests: Fix reporting of test failures + +After commit a4afb898f7758160acda71d774c7d98d528da273 the testsuite +no longer reported test failures. This is because we rely on the exit +status code of the script, and currently, this is always 0. + +If any test fails, we will exit with status code 2. The entire testsuite +will continue to run, even after a test has failed. +--- + tests/testit.sh | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +diff --git a/tests/testit.sh b/tests/testit.sh +index 04713f5..26724d6 100755 +--- a/tests/testit.sh ++++ b/tests/testit.sh +@@ -8,6 +8,7 @@ run() { + result=`HOME=$builddir $builddir/$prog $*` + if [ "$answer" != "$result" ]; then + echo "FAIL: $name: \"$result\" != \"$answer\" " ++ retval=2 + else + echo "PASS: $name" + fi +@@ -30,6 +31,7 @@ run_diff() { + if [ "$diff_ret" != "0" ]; then + echo "FAIL $name: failed output is in $out, diff is:" + cat $diff_file ++ retval=2 + else + echo "PASS $name" + fi +@@ -37,6 +39,7 @@ run_diff() { + } + + builddir=`pwd` ++retval=0 + cd ${builddir} + echo "Running tests in ${builddir}" + +@@ -181,4 +184,9 @@ run_diff test3 "test3 - 2" test3-data/02.input test3-data/02.answer + run_diff test3 "test3 - 3" test3-data/03.input test3-data/03.answer + + echo "" +-echo "Passed." ++if [ $retval != 0 ]; then ++ echo "Failed." ++ exit $retval ++else ++ echo "Passed." ++fi +-- +2.27.0 + diff --git a/popt.spec b/popt.spec index c27e7f889c5b39513d7b053291493ba51509141d..a1c39f35b8150911559c0c11da8d8e9ef11ca85c 100644 --- a/popt.spec +++ b/popt.spec @@ -1,4 +1,4 @@ -%define anolis_release 1 +%define anolis_release 2 Summary: C library for parsing command line parameters Name: popt @@ -21,6 +21,9 @@ arguments to be aliased via configuration files and includes utility functions for parsing arbitrary strings into argv[] arrays using shell-like rules. +# Upstream patches +Patch1: 0001-tests-Fix-reporting-of-test-failures.patch + %package devel Summary: Development files for the popt library Requires: %{name} = %{version}-%{release}, pkgconfig @@ -71,10 +74,14 @@ make check || cat tests/*.log %ldconfig_scriptlets +%generate_compatibility_deps + %files -f %{name}.lang %license COPYING +%dir %{abidir} %{_sysconfdir}/popt.d/ %{_libdir}/libpopt.so.* +%{abidir}/libpopt.dump %files devel %{_libdir}/libpopt.so @@ -88,11 +95,14 @@ make check || cat tests/*.log %endif %files doc -%doc README +%doc README ABOUT-NLS CREDITS %changelog +* Mon Jan 09 2023 Jing Zhang - 1.19.2 +- fix reporting of test failures and optimize spec + * Wed Sep 21 2022 mgb01105731 - 1.19-1 - update to 1.19 -* Wed Mar 08 2022 Renbo - 1.18-1 +* Tue Mar 08 2022 Renbo - 1.18-1 - Init for Anolis OS 23