[neon/extras/kraft/Neon/release] debian: more tests fixes

Pino Toscano null at kde.org
Wed Oct 4 11:17:06 BST 2023


Git commit e116cdd9ca376ab31ca71b951a2ea6f97ad259eb by Pino Toscano.
Committed on 17/09/2023 at 05:20.
Pushed by jriddell into branch 'Neon/release'.

more tests fixes

sigh, this is becoming hard

M  +4    -2    debian/changelog
M  +1    -0    debian/patches/series
A  +31   -0    debian/patches/tests-dateformat.diff
M  +1    -1    debian/rules

https://invent.kde.org/neon/extras/kraft/-/commit/e116cdd9ca376ab31ca71b951a2ea6f97ad259eb

diff --git a/debian/changelog b/debian/changelog
index 0188e7e..247127d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -11,9 +11,11 @@ kraft (1.1-0r1) UNRELEASED; urgency=medium
       patch cmake-fix-without-git.diff
     - create a ".tag" file for the cmake run, since apparently the build system
       assumes it is there (while it is not) in case .git is not present
-  * Try to make the tests pass:
+  * Make the tests pass:
     - add the locales-all build dependency
-    - run tests using the de_DE.utf8 locale
+    - run tests using the C.utf8 locale
+    - fix the expected date strings when no date format is configured; patch
+      tests-dateformat.diff
 
  -- Debian KDE Extras Team <pkg-kde-extras at lists.alioth.debian.org>  Sun, 17 Sep 2023 03:50:07 +0200
 
diff --git a/debian/patches/series b/debian/patches/series
index 94d0e5f..e7f723b 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
 tests-skip-t_defaultprovider.diff
 cmake-fix-without-git.diff
+tests-dateformat.diff
diff --git a/debian/patches/tests-dateformat.diff b/debian/patches/tests-dateformat.diff
new file mode 100644
index 0000000..3c6630b
--- /dev/null
+++ b/debian/patches/tests-dateformat.diff
@@ -0,0 +1,31 @@
+Author: Pino Toscano <pino at debian.org>
+Description: Fix tests when formatting with the default configuration
+ The default DateFormat configuration is empty, which means that
+ Format::toDateString() uses the Qt::DefaultLocaleShortDate format for dates.
+ Hence, adjust the expected date strings.
+Last-Update: 2023-09-17
+Forwarded: no
+
+--- a/tests/t_kraftdoc.cpp
++++ b/tests/t_kraftdoc.cpp
+@@ -239,17 +239,17 @@ private slots:
+         QString tmpl{"This is 12 days later than 24.01.2020: DATE_ADD_DAYS(12)"};
+         QString expanded = kraftdoc->resolveMacros(tmpl, positions, d, fullTax, redTax);
+ 
+-        QString shouldBe{"This is 12 days later than 24.01.2020: 05.02.2020"};
++        QString shouldBe{"This is 12 days later than 24.01.2020: 05.02.20"};
+         QCOMPARE(expanded, shouldBe);
+ 
+         tmpl = "This is 0 days later than 24.01.2020: DATE_ADD_DAYS(0)";
+         expanded = kraftdoc->resolveMacros(tmpl, positions, d, fullTax, redTax);
+-        shouldBe = "This is 0 days later than 24.01.2020: 24.01.2020";
++        shouldBe = "This is 0 days later than 24.01.2020: 24.01.20";
+         QCOMPARE(expanded, shouldBe);
+ 
+         tmpl = "This is -5 days later than 24.01.2020: DATE_ADD_DAYS(-5)";
+         expanded = kraftdoc->resolveMacros(tmpl, positions, d, fullTax, redTax);
+-        shouldBe = "This is -5 days later than 24.01.2020: 19.01.2020";
++        shouldBe = "This is -5 days later than 24.01.2020: 19.01.20";
+         QCOMPARE(expanded, shouldBe);
+     }
+ 
diff --git a/debian/rules b/debian/rules
index 8a70b29..ac958c7 100755
--- a/debian/rules
+++ b/debian/rules
@@ -14,4 +14,4 @@ override_dh_auto_configure:
 	rm .tag
 
 override_dh_auto_test:
-	xvfb-run -a env KRAFT_HOME="$(CURDIR)" LC_ALL=de_DE.utf8 dh_auto_test --no-parallel
+	xvfb-run -a env KRAFT_HOME="$(CURDIR)" LC_ALL=C.utf8 dh_auto_test --no-parallel



More information about the Neon-commits mailing list