From: Simon McVittie <smcv@debian.org>
Date: Tue, 11 Sep 2018 15:59:31 +0100
Subject: tests: Add the ability to skip tests according to dpkg-architecture

This avoids needing to work out what the value of XPCOMABI will be
for a particular Debian architecture. It cannot be used in
upstreamable patches, though.

Forwarded: not-needed, Debian-specific
---
 js/src/tests/lib/manifest.py | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/js/src/tests/lib/manifest.py b/js/src/tests/lib/manifest.py
index a7590b1..88b71c8 100644
--- a/js/src/tests/lib/manifest.py
+++ b/js/src/tests/lib/manifest.py
@@ -3,6 +3,7 @@
 # This includes classes for representing and parsing JS manifests.
 
 import io
+import json
 import os
 import posixpath
 import re
@@ -36,18 +37,30 @@ class XULInfo:
         """Return JS that when executed sets up variables so that JS expression
         predicates on XUL build info evaluate properly."""
 
+        debian = {}
+        p = Popen(
+            ['dpkg-architecture', '-a' + os.environ['DEB_HOST_ARCH']],
+            stdout=PIPE,
+            universal_newlines=True,
+        )
+        for line in p.stdout:
+            k, v = line.rstrip('\n').split('=', 1)
+            debian[k] = v
+        p.wait()
+
         return (
             "var winWidget = {};"
             "var gtkWidget = {};"
             "var cocoaWidget = {};"
             "var is64Bit = {};"
-            "var xulRuntime = {{ shell: true }};"
+            "var xulRuntime = {{ debian: {}, shell: true }};"
             "var release_or_beta = getBuildConfiguration('release_or_beta');"
             "var isDebugBuild={}; var Android={}; ".format(
                 str(self.os == "WINNT").lower(),
                 str(self.os == "Darwin").lower(),
                 str(self.os == "Linux").lower(),
                 str("x86-" not in self.abi).lower(),
+                json.dumps(debian),
                 str(self.isdebug).lower(),
                 str(self.os == "Android").lower(),
             )
