Compare commits

..

No commits in common. "rawhide" and "f43" have entirely different histories.

9 changed files with 64 additions and 41 deletions

View file

@ -1 +0,0 @@
1

View file

@ -1,6 +1,6 @@
Name: opencc
Version: 1.1.9
Release: 5%{?dist}
Release: 4%{?dist}
Summary: Libraries for Simplified-Traditional Chinese Conversion
License: Apache-2.0
URL: https://github.com/BYVoid/OpenCC
@ -82,10 +82,6 @@ developing applications that use %{name}.
%{_libdir}/cmake/opencc/OpenCC*.cmake
%changelog
* Thu Aug 21 2025 Peng Wu <pwu@redhat.com> - 1.1.9-5
- Update CI tests
- Resolves: RHBZ#2382996
* Tue Aug 12 2025 Peng Wu <pwu@redhat.com> - 1.1.9-4
- Update for https://fedoraproject.org/wiki/Changes/CMake_drop_install_vars
- Resolves: RHBZ#2381327

View file

@ -1,5 +0,0 @@
summary: Basic smoke test
discover:
how: fmf
execute:
how: tmt

View file

@ -1,5 +0,0 @@
test: ./runtest.sh
duration: 50m
framework: beakerlib
require:
- opencc-tools

View file

@ -0,0 +1,2 @@
role_pkgs_req:
- rsync

View file

@ -0,0 +1,4 @@
---
dependencies:
- role: str-common-init

View file

@ -0,0 +1,47 @@
---
- name: Check if opencc is installed
register: opencc_testing_runner
find:
paths: "{{ ansible_env.PATH.split(':') }}"
pattern: opencc
- name: Install opencc-tools
when: opencc_testing_runner.matched == 0
block:
- name: Installing opencc-tools
package:
name:
- opencc-tools
- name: Start opencc tests
block:
- name: Execute tests
shell: |
set -e
log_file="{{ remote_artifacts }}/{{ installed_test_name }}.log"
exec 2>>$log_file 1>>$log_file
echo "Starting opencc tests"
TEST=opencc
status="FAIL"
opencc >> "{{ remote_artifacts }}/test.log" <<EOF
测试
EOF
grep "測試" "{{ remote_artifacts }}/test.log"
if [ $? -eq 0 ]; then
status="PASS"
fi
echo "${status} $TEST" >> {{ remote_artifacts }}/test.log
- name: Check the results
shell: grep "^FAIL" {{ remote_artifacts }}/test.log
register: test_fails
failed_when: False
- name: Set role result
set_fact:
role_result_failed: "{{ (test_fails.stdout|d|length > 0) or (test_fails.stderr|d|length > 0) }}"
role_result_msg: "{{ test_fails.stdout|d('tests failed.') }}"
- include_role:
name: str-common-final

View file

@ -1,25 +0,0 @@
#!/bin/bash
. /usr/share/beakerlib/beakerlib.sh || exit 1
rlJournalStart
rlPhaseStartSetup
rlShowPackageVersion opencc
rlRun -t -l "VERSION=$(rpm -q opencc --queryformat='%{version}')" 0 "Get VERSION"
FEDORA_VERSION=$(rlGetDistroRelease)
rlLog "FEDORA_VERSION=${DISTRO_RELEASE}"
rlRun "tmp=\$(mktemp -d)" 0 "Create tmp directory"
rlRun "pushd $tmp"
rlPhaseEnd
rlPhaseStartTest
rlRun "set -o pipefail"
rlRun "echo '测试'>input.txt" 0 "Generate input.txt"
rlRun "opencc -i input.txt -o output.txt" 0 "Run opencc tool"
rlRun "grep '測試' output.txt" 0 "Check output.txt"
rlPhaseEnd
rlPhaseStartCleanup
rlRun "popd"
rlRun "rm -r $tmp" 0 "Remove tmp directory"
rlPhaseEnd
rlJournalEnd

10
tests/tests.yml Normal file
View file

@ -0,0 +1,10 @@
- hosts: localhost
roles:
- role: opencc-testing-role
installed_test_name: opencc
tags:
- classic
- gating
required_packages:
- opencc-tools