Bug 1496238 - Part 2: Allow BinAST directives files in jit_tests. (r=Waldo)
authorEric Faust <efausbmo@gmail.com>
Tue, 09 Oct 2018 14:17:43 -0700
changeset 496109 4d07362984d4e00ef10251fa54e652426d87bfcf
parent 496108 105ad7200afcc1ed4429dfae3f0a62e29925db02
child 496110 38890d8fa2542082eafe6e16dfc26b87d42ade94
push id9984
push userffxbld-merge
push dateMon, 15 Oct 2018 21:07:35 +0000
treeherdermozilla-beta@183d27ea8570 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersWaldo
bugs1496238
milestone64.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1496238 - Part 2: Allow BinAST directives files in jit_tests. (r=Waldo)
js/src/tests/lib/jittests.py
--- a/js/src/tests/lib/jittests.py
+++ b/js/src/tests/lib/jittests.py
@@ -222,22 +222,26 @@ class JitTest:
         if dir_name in cls.Directives:
             dir_meta = cls.Directives[dir_name]
         else:
             meta_file_name = os.path.join(dir_name, "directives.txt")
             if os.path.exists(meta_file_name):
                 dir_meta = cls.find_directives(meta_file_name)
             cls.Directives[dir_name] = dir_meta
 
-        file_extension = os.path.splitext(path)[1]
+        filename, file_extension = os.path.splitext(path)
         if file_extension == '.binjs':
             # BinAST does not have an inline comment format, so it's hard
-            # to parse file-by-file directives. In future, we can look for
-            # an adjacent test-specific directives file, if we want.
-            meta = ''
+            # to parse file-by-file directives. Allow foo.binjs to use foo.dir
+            # as an adjacent file to specify.
+            meta_file_name = filename + '.dir'
+            if os.path.exists(meta_file_name):
+                meta = cls.find_directives(meta_file_name)
+            else:
+                meta = ''
             test.is_binast = True
         else:
             meta = cls.find_directives(path)
 
         if meta != '' or dir_meta != '':
             meta = meta + dir_meta
             parts = meta.split(';')
             for part in parts: