summaryrefslogtreecommitdiffstats
path: root/config/check_js_opcode.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
commit36d22d82aa202bb199967e9512281e9a53db42c9 (patch)
tree105e8c98ddea1c1e4784a60a5a6410fa416be2de /config/check_js_opcode.py
parentInitial commit. (diff)
downloadfirefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz
firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'config/check_js_opcode.py')
-rw-r--r--config/check_js_opcode.py47
1 files changed, 47 insertions, 0 deletions
diff --git a/config/check_js_opcode.py b/config/check_js_opcode.py
new file mode 100644
index 0000000000..b6a6c1f1c8
--- /dev/null
+++ b/config/check_js_opcode.py
@@ -0,0 +1,47 @@
+# vim: set ts=8 sts=4 et sw=4 tw=99:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+# ----------------------------------------------------------------------------
+# This script checks bytecode documentation in js/src/vm/Opcodes.h
+# ----------------------------------------------------------------------------
+
+import os
+import sys
+
+scriptname = os.path.basename(__file__)
+topsrcdir = os.path.dirname(os.path.dirname(__file__))
+
+
+def log_pass(text):
+ print("TEST-PASS | {} | {}".format(scriptname, text))
+
+
+def log_fail(text):
+ print("TEST-UNEXPECTED-FAIL | {} | {}".format(scriptname, text))
+
+
+def check_opcode():
+ sys.path.insert(0, os.path.join(topsrcdir, "js", "src", "vm"))
+ import jsopcode
+
+ try:
+ jsopcode.get_opcodes(topsrcdir)
+ except Exception as e:
+ log_fail(e.args[0])
+ return False
+
+ log_pass("ok")
+ return True
+
+
+def main():
+ if not check_opcode():
+ sys.exit(1)
+
+ sys.exit(0)
+
+
+if __name__ == "__main__":
+ main()