summaryrefslogtreecommitdiff
path: root/test/testpy
diff options
context:
space:
mode:
authorDaniel Bevenius <daniel.bevenius@gmail.com>2017-03-01 08:16:48 +0100
committerDaniel Bevenius <daniel.bevenius@gmail.com>2017-03-04 20:16:52 +0100
commit1402fef098309bf7fd902d0be86cd8a1a3e07b86 (patch)
tree189a1119a63898f9ea38d3fd6992f22d66f00b6e /test/testpy
parent93525287791c8b16012a146623982d31e1f18775 (diff)
downloadandroid-node-v8-1402fef098309bf7fd902d0be86cd8a1a3e07b86.tar.gz
android-node-v8-1402fef098309bf7fd902d0be86cd8a1a3e07b86.tar.bz2
android-node-v8-1402fef098309bf7fd902d0be86cd8a1a3e07b86.zip
test: make tests pass when configured without-ssl
Currently when node is build --without-ssl and the test are run, there are a number of failing test due to tests expecting crypto support to be available. This commit fixes fixes the failure and instead skips the tests that expect crypto to be available. PR-URL: https://github.com/nodejs/node/pull/11631 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'test/testpy')
-rw-r--r--test/testpy/__init__.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/test/testpy/__init__.py b/test/testpy/__init__.py
index 367346f6e1..d7ec88992e 100644
--- a/test/testpy/__init__.py
+++ b/test/testpy/__init__.py
@@ -29,6 +29,7 @@ import test
import os
from os.path import join, dirname, exists
import re
+import ast
FLAGS_PATTERN = re.compile(r"//\s+Flags:(.*)")
@@ -64,7 +65,18 @@ class SimpleTestCase(test.TestCase):
# PORT should match the definition in test/common.js.
env = { 'PORT': int(os.getenv('NODE_COMMON_PORT', '12346')) }
env['PORT'] += self.thread_id * 100
- result += flags_match.group(1).strip().format(**env).split()
+ flag = flags_match.group(1).strip().format(**env).split()
+ # The following block reads config.gypi to extract the v8_enable_inspector
+ # value. This is done to check if the inspector is disabled in which case
+ # the '--inspect' flag cannot be passed to the node process as it will
+ # cause node to exit and report the test as failed. The use case
+ # is currently when Node is configured --without-ssl and the tests should
+ # still be runnable but skip any tests that require ssl (which includes the
+ # inspector related tests).
+ if flag[0].startswith('--inspect') and self.context.v8_enable_inspector == 0:
+ print('Skipping as inspector is disabled')
+ else:
+ result += flag
files_match = FILES_PATTERN.search(source);
additional_files = []
if files_match: