Add two test fixes from Debian

This commit is contained in:
Kalev Lember 2018-05-11 13:23:43 +02:00
parent ffed5a7c4b
commit fd1c86bf24
3 changed files with 51 additions and 1 deletions

View File

@ -22,10 +22,12 @@ Source0: https://ftp.mozilla.org/pub/firefox/releases/%{version}esr/sourc
# Patches from Debian mozjs52_52.3.1-4.debian.tar.xz:
Patch0001: fix-soname.patch
Patch0002: copy-headers.patch
Patch0003: tests-increase-timeout.patch
Patch0004: tests-snans-be.patch
# Disable JS Helper threads on ppc64le
# https://bugzilla.redhat.com/show_bug.cgi?id=1523121
Patch0003: disable-extra-threads.patch
Patch0010: disable-extra-threads.patch
# Patches from https://github.com/ptomato/mozjs / Debian mozjs52_52.3.1-4.debian.tar.xz
Patch0101: disable-mozglue.patch
@ -72,6 +74,9 @@ pushd ../..
%patch0001 -p1
%patch0002 -p1
%patch0003 -p1
%patch0004 -p1
%patch0010 -p1
%patch0101 -p1
%patch0104 -p1

View File

@ -0,0 +1,16 @@
Description: Increase the test timeout for slower buildds
Author: Adrian Bunk <bunk@debian.org>
Bug-Debian: https://bugs.debian.org/878284
--- mozjs52-52.3.1.orig/js/src/Makefile.in
+++ mozjs52-52.3.1/js/src/Makefile.in
@@ -104,7 +104,7 @@ check:: check-style check-masm check-js-
check-jstests:
$(wildcard $(RUN_TEST_PROGRAM)) $(PYTHON) -u $(srcdir)/tests/jstests.py \
- --no-progress --format=automation --timeout 300 \
+ --no-progress --format=automation --timeout 600 \
$(JSTESTS_EXTRA_ARGS) \
$(DIST)/bin/$(JS_SHELL_NAME)$(BIN_SUFFIX)

29
tests-snans-be.patch Normal file
View File

@ -0,0 +1,29 @@
Description: Fix sort_snans.js test on big endian
Author: Adrian Bunk <bunk@debian.org>
Bug-Debian: https://bugs.debian.org/878285
--- mozjs52-52.3.1.orig/js/src/tests/ecma_6/TypedArray/sort_snans.js
+++ mozjs52-52.3.1/js/src/tests/ecma_6/TypedArray/sort_snans.js
@@ -34,8 +34,20 @@ function testFloat32NaNRanges(start, end
// and startHi, startLow and endHi, endLow should be 32-bit integers which,
// when combined (Hi + Low), form Float64 NaNs.
function testFloat64NaNRanges(startHi, startLow, endHi, endLow) {
- let skipN = 10e6;
+ // Swap on big endian platforms
+ if ((new Uint32Array((new Uint8Array([1,2,3,4])).buffer))[0] === 0x01020304) {
+ let tmp = startHi;
+ startHi = startLow;
+ startLow = tmp;
+
+ tmp = endHi;
+ endHi = endLow;
+ endLow = tmp;
+ }
+
+ let skipN = 10e6;
+
let sampleSizeHi = Math.floor((endHi - startHi)/skipN);
let sampleSizeLow = Math.floor((endLow - startLow)/skipN);