Bug 1522096 - Skip BinAST jit-tests if BinAST is not enabled. r=sfink
authorTooru Fujisawa <arai_a@mac.com>
Fri, 25 Jan 2019 18:35:43 +0000
changeset 515506 b2261781d719058d48913a1330071a3fcfb75976
parent 515505 4be8f5920abed49744da0df35400b1ac00c5c50c
child 515507 d6ce4b187195a3e5a763c810578e928b628847aa
push id1953
push userffxbld-merge
push dateMon, 11 Mar 2019 12:10:20 +0000
treeherdermozilla-release@9c35dcbaa899 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssfink
bugs1522096
milestone66.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 1522096 - Skip BinAST jit-tests if BinAST is not enabled. r=sfink Differential Revision: https://phabricator.services.mozilla.com/D17475
js/src/builtin/TestingFunctions.cpp
js/src/jit-test/jit_test.py
--- a/js/src/builtin/TestingFunctions.cpp
+++ b/js/src/builtin/TestingFunctions.cpp
@@ -361,16 +361,25 @@ static bool GetBuildConfiguration(JSCont
   value = BooleanValue(true);
 #else
   value = BooleanValue(false);
 #endif
   if (!JS_SetProperty(cx, info, "moz-memory", value)) {
     return false;
   }
 
+#if defined(JS_BUILD_BINAST)
+  value = BooleanValue(true);
+#else
+  value = BooleanValue(false);
+#endif
+  if (!JS_SetProperty(cx, info, "binast", value)) {
+    return false;
+  }
+
   value.setInt32(sizeof(void*));
   if (!JS_SetProperty(cx, info, "pointer-byte-size", value)) {
     return false;
   }
 
   args.rval().setObject(*info);
   return true;
 }
--- a/js/src/jit-test/jit_test.py
+++ b/js/src/jit-test/jit_test.py
@@ -224,16 +224,26 @@ def main(argv):
     options.wasm_enabled = True
     if all(['--no-asmjs' in flags for flags in test_flags]):
         options.asmjs_enabled = False
         options.wasm_enabled = False
     if all(['--wasm-compiler=none' in flags for flags in test_flags]):
         options.asmjs_enabled = False
         options.wasm_enabled = False
 
+    if options.run_binast:
+        code = 'print(getBuildConfiguration().binast)'
+        is_binast_enabled = subprocess.check_output([js_shell, '-e', code])
+        if not is_binast_enabled.startswith('true'):
+            print("While --run-binast is specified, BinAST is not enabled.",
+                  file=sys.stderr)
+            print("BinAST testcases will be skipped.",
+                  file=sys.stderr)
+            options.run_binast = False
+
     if test_args:
         read_all = False
         for arg in test_args:
             test_list += jittests.find_tests(arg, run_binast=options.run_binast)
 
     if options.read_tests:
         read_all = False
         try: