public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/unicode-ucd] rawhide: test.py now takes a filepath and is run in %check too
@ 2026-09-17  8:19 Jens Petersen
  0 siblings, 0 replies; only message in thread
From: Jens Petersen @ 2026-09-17  8:19 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/unicode-ucd
            Branch : rawhide
            Commit : 5c5da87f637aa9cb85f58f454042b015180c72a4
            Author : Jens Petersen <petersen@redhat.com>
            Date   : 2026-09-17T16:19:04+08:00
            Stats  : +23/-5 in 4 file(s)
            URL    : https://src.fedoraproject.org/rpms/unicode-ucd/c/5c5da87f637aa9cb85f58f454042b015180c72a4?branch=rawhide

            Log:
            test.py now takes a filepath and is run in %check too

- make test.py executable

---
diff --git a/test.py b/test.py
new file mode 120000
index 0000000..58393dc
--- /dev/null
+++ b/test.py
@@ -0,0 +1 @@
+tests/parse/test.py
\ No newline at end of file

diff --git a/tests/parse/main.fmf b/tests/parse/main.fmf
index f972409..0fd28eb 100644
--- a/tests/parse/main.fmf
+++ b/tests/parse/main.fmf
@@ -2,5 +2,5 @@ summary: parse unicode data
 require:
 - unicode-ucd
 - python3
-test: python3 test.py
+test: ./test.py /usr/share/unicode/ucd/UnicodeData.txt
 framework: shell

diff --git a/tests/parse/test.py b/tests/parse/test.py
old mode 100644
new mode 100755
index 465dcbf..641a93a
--- a/tests/parse/test.py
+++ b/tests/parse/test.py
@@ -1,10 +1,18 @@
 #!/usr/bin/env python3
 
-codepoints = 0
+import sys
+
+script_name = sys.argv[0]
 
-file = '/usr/share/unicode/ucd/UnicodeData.txt'
+try:
+    filepath = sys.argv[1]
+except IndexError:
+    print(f"Usage: {script_name} <filepath>", file=sys.stderr)
+    sys.exit(1)
+
+codepoints = 0
 
-with open(file, mode='rt', encoding='ascii') as unicode_data:
+with open(filepath, mode='rt', encoding='ascii') as unicode_data:
     for line in unicode_data.readlines():
         codepoint_string, name, category = line.split(';')[:3]
         codepoint = int(codepoint_string, 16)

diff --git a/unicode-ucd.spec b/unicode-ucd.spec
index 2a4a7ac..8e7b5aa 100644
--- a/unicode-ucd.spec
+++ b/unicode-ucd.spec
@@ -4,7 +4,7 @@
 
 Name:           unicode-ucd
 Version:        18.0.0
-Release:        1%{?dist}
+Release:        2%{?dist}
 Summary:        Unicode Character Database
 
 # http://www.unicode.org/terms_of_use.html in ReadMe.txt redirects to:
@@ -17,7 +17,9 @@ URL:            http://www.unicode.org/ucd/
 Source0:        https://www.unicode.org/Public/%{version}/ucd/UCD.zip
 Source1:        https://www.unicode.org/Public/%{version}/ucd/Unihan.zip
 Source2:        https://www.unicode.org/license.txt
+Source3:        test.py
 BuildArch:      noarch
+BuildRequires:  python3
 
 %description
 The Unicode Character Database (UCD) consists of a number of data files listing
@@ -52,6 +54,10 @@ cp -p %{SOURCE1} %{buildroot}%{ucddir}
 cp %{SOURCE2} .
 
 
+%check
+%{SOURCE3} %{buildroot}%{ucddir}/UnicodeData.txt
+
+
 %files
 %license license.txt
 %dir %{unicodedir}
@@ -63,6 +69,9 @@ cp %{SOURCE2} .
 
 
 %changelog
+* Thu Sep 17 2026 Jens Petersen <petersen@redhat.com> - 18.0.0-2
+- run test.py script also in the check section
+
 * Thu Sep 17 2026 Jens Petersen <petersen@redhat.com> - 18.0.0-1
 - https://www.unicode.org/versions/Unicode18.0.0/ (#2434378)
 - https://blog.unicode.org/2026/09/announcing-unicode-standard-version-180.html

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-09-17  8:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-17  8:19 [rpms/unicode-ucd] rawhide: test.py now takes a filepath and is run in %check too Jens Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox