Bug 1509898 [wpt PR 14236] - Simplify interpolation of 2-D matrix transforms., a...
[gecko.git] / config / check_js_opcode.py
blobceaa273ab92345d49d0a1c9e9b0dbd36152db3ef
1 # vim: set ts=8 sts=4 et sw=4 tw=99:
2 # This Source Code Form is subject to the terms of the Mozilla Public
3 # License, v. 2.0. If a copy of the MPL was not distributed with this
4 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
6 # ----------------------------------------------------------------------------
7 # This script checks bytecode documentation in js/src/vm/Opcodes.h
8 # ----------------------------------------------------------------------------
10 from __future__ import print_function
12 import os
13 import sys
15 scriptname = os.path.basename(__file__)
16 topsrcdir = os.path.dirname(os.path.dirname(__file__))
19 def log_pass(text):
20 print('TEST-PASS | {} | {}'.format(scriptname, text))
23 def log_fail(text):
24 print('TEST-UNEXPECTED-FAIL | {} | {}'.format(scriptname, text))
27 def check_opcode():
28 sys.path.insert(0, os.path.join(topsrcdir, 'js', 'src', 'vm'))
29 import jsopcode
31 try:
32 jsopcode.get_opcodes(topsrcdir)
33 except Exception as e:
34 log_fail(e.args[0])
35 return False
37 log_pass('ok')
38 return True
41 def main():
42 if not check_opcode():
43 sys.exit(1)
45 sys.exit(0)
48 if __name__ == '__main__':
49 main()