| 1 |
From: Simon McVittie <[email protected]> |
| 2 |
Date: Tue, 11 Sep 2018 15:59:31 +0100 |
| 3 |
Subject: tests: Add the ability to skip tests according to dpkg-architecture |
| 4 |
|
| 5 |
This avoids needing to work out what the value of XPCOMABI will be |
| 6 |
for a particular Debian architecture. It cannot be used in |
| 7 |
upstreamable patches, though. |
| 8 |
|
| 9 |
Forwarded: not-needed, Debian-specific |
| 10 |
--- |
| 11 |
js/src/tests/lib/manifest.py | 15 ++++++++++++++- |
| 12 |
1 file changed, 14 insertions(+), 1 deletion(-) |
| 13 |
|
| 14 |
diff --git a/js/src/tests/lib/manifest.py b/js/src/tests/lib/manifest.py |
| 15 |
index dcad53b..59f968a 100644 |
| 16 |
--- a/js/src/tests/lib/manifest.py |
| 17 |
+++ b/js/src/tests/lib/manifest.py |
| 18 |
@@ -3,6 +3,7 @@ |
| 19 |
# This includes classes for representing and parsing JS manifests. |
| 20 |
|
| 21 |
import os |
| 22 |
+import json |
| 23 |
import posixpath |
| 24 |
import re |
| 25 |
import sys |
| 26 |
@@ -33,18 +34,30 @@ class XULInfo: |
| 27 |
"""Return JS that when executed sets up variables so that JS expression |
| 28 |
predicates on XUL build info evaluate properly.""" |
| 29 |
|
| 30 |
+ debian = {} |
| 31 |
+ p = Popen( |
| 32 |
+ ['dpkg-architecture', '-a' + os.environ['DEB_HOST_ARCH']], |
| 33 |
+ stdout=PIPE, |
| 34 |
+ universal_newlines=True, |
| 35 |
+ ) |
| 36 |
+ for line in p.stdout: |
| 37 |
+ k, v = line.rstrip('\n').split('=', 1) |
| 38 |
+ debian[k] = v |
| 39 |
+ p.wait() |
| 40 |
+ |
| 41 |
return ( |
| 42 |
"var winWidget = {};" |
| 43 |
"var gtkWidget = {};" |
| 44 |
"var cocoaWidget = {};" |
| 45 |
"var is64Bit = {};" |
| 46 |
- "var xulRuntime = {{ shell: true }};" |
| 47 |
+ "var xulRuntime = {{ debian: {}, shell: true }};" |
| 48 |
"var release_or_beta = getBuildConfiguration('release_or_beta');" |
| 49 |
"var isDebugBuild={}; var Android={}; ".format( |
| 50 |
str(self.os == "WINNT").lower(), |
| 51 |
str(self.os == "Darwin").lower(), |
| 52 |
str(self.os == "Linux").lower(), |
| 53 |
str("x86-" not in self.abi).lower(), |
| 54 |
+ json.dumps(debian), |
| 55 |
str(self.isdebug).lower(), |
| 56 |
str(self.os == "Android").lower(), |
| 57 |
) |