summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorkfg2018-08-03 15:53:44 +0200
committerkfg2018-08-03 15:53:44 +0200
commit4888fc344c27fe2deb325dbefa6e547ce664cf15 (patch)
treec8ac8868e634718a2790d4fd6c32ddaa876c5735
parent169207f659b673f244324737f1bf827c09c9c163 (diff)
downloadaur-4888fc344c27fe2deb325dbefa6e547ce664cf15.tar.gz
Explicitly run tests with wine
-rw-r--r--.SRCINFO6
-rw-r--r--PKGBUILD28
-rw-r--r--testrunnerwine.patch30
3 files changed, 50 insertions, 14 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 04dda2f362f8..9c66c11326fa 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,5 +1,5 @@
# Generated by mksrcinfo v8
-# Fri Aug 3 13:19:51 UTC 2018
+# Fri Aug 3 13:51:18 UTC 2018
pkgbase = mingw-w64-fribidi
pkgdesc = A Free Implementation of the Unicode Bidirectional Algorithm (mingw-w64)
pkgver = 1.0.5
@@ -17,7 +17,9 @@ pkgbase = mingw-w64-fribidi
options = !libtool
options = staticlibs
source = git+https://github.com/fribidi/fribidi#commit=5b6a16e8da12ae7ff482fbfa5a17b72bd518418f
- md5sums = SKIP
+ source = testrunnerwine.patch
+ sha256sums = SKIP
+ sha256sums = 5a3b01779035608220e6af54d803006295b237a05ddaaf4781ab143317d8ec15
pkgname = mingw-w64-fribidi
diff --git a/PKGBUILD b/PKGBUILD
index 1c8f93b570ba..a4fb53631452 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -10,13 +10,18 @@ url="http://fribidi.org"
depends=('mingw-w64-crt')
options=('!strip' '!buildflags' '!libtool' 'staticlibs')
makedepends=('mingw-w64-gcc' 'mingw-w64-meson' 'mingw-w64-wine' 'git')
-#Makedepends with tests
-#makedepends=('mingw-w64-gcc' 'mingw-w64-meson' 'mingw-w64-wine' 'git' 'dos2unix')
_commit=5b6a16e8da12ae7ff482fbfa5a17b72bd518418f # tags/v1.0.5^0
-source=("git+https://github.com/fribidi/fribidi#commit=$_commit")
-md5sums=('SKIP')
+source=("git+https://github.com/fribidi/fribidi#commit=$_commit"
+ "testrunnerwine.patch")
+sha256sums=('SKIP'
+ '5a3b01779035608220e6af54d803006295b237a05ddaaf4781ab143317d8ec15')
_architectures="i686-w64-mingw32 x86_64-w64-mingw32"
+prepare() {
+ cd ${srcdir}/fribidi
+ patch -Np1 -i ${srcdir}/testrunnerwine.patch
+}
+
build() {
export NEED_WINE=1
for _arch in ${_architectures}; do
@@ -27,14 +32,13 @@ build() {
done
}
-#check() {
-# export NEED_WINE=1
-# unix2dos ${srcdir}/fribidi/test/*.reference
-# for _arch in ${_architectures}; do
-# cp ${srcdir}/fribidi/build-${_arch}/lib/*.dll ${srcdir}/fribidi/build-${_arch}/bin/
-# meson test -C ${srcdir}/fribidi/build-${_arch}
-# done
-#}
+check() {
+ export NEED_WINE=1
+ for _arch in ${_architectures}; do
+ cp ${srcdir}/fribidi/build-${_arch}/lib/*.dll ${srcdir}/fribidi/build-${_arch}/bin/
+ meson test -C ${srcdir}/fribidi/build-${_arch}
+ done
+}
package() {
for _arch in ${_architectures}; do
diff --git a/testrunnerwine.patch b/testrunnerwine.patch
new file mode 100644
index 000000000000..d91794d44651
--- /dev/null
+++ b/testrunnerwine.patch
@@ -0,0 +1,30 @@
+diff -ruN fribidi/test/test-runner.py patched/test/test-runner.py
+--- fribidi/test/test-runner.py 2018-08-03 15:45:55.064198589 +0200
++++ patched/test/test-runner.py 2018-08-03 15:46:13.544532687 +0200
+@@ -14,6 +14,7 @@
+ charset = sys.argv[2]
+ input_file = sys.argv[3]
+ reference_file = sys.argv[4]
++run_with_wine = False
+
+ if os.name == 'nt':
+ libpath = os.path.join(os.path.dirname(os.path.realpath(test_exe)),
+@@ -21,10 +22,16 @@
+ 'lib')
+ os.environ['PATH'] = libpath + ';' + os.environ['PATH']
+
++if os.environ.get('NEED_WINE') == '1':
++ run_with_wine = True
++
+ try:
+- output = subprocess.check_output([test_exe, '--test', '--charset', charset, input_file])
++ if run_with_wine:
++ output = subprocess.check_output(['wine', test_exe, '--test', '--charset', charset, input_file])
++ else:
++ output = subprocess.check_output([test_exe, '--test', '--charset', charset, input_file])
+ ref_data = open(reference_file, "rb").read()
+- if os.name == 'nt':
++ if os.name == 'nt' or run_with_wine:
+ output = output.replace(b'\r\n', b'\n')
+ ref_data = ref_data.replace(b'\r\n', b'\n')
+ if output != ref_data: