| 67 | return self.path[-1] |
| 68 | |
| 69 | def GetRunConfiguration(self): |
| 70 | result = [self.config.context.GetVm(self.arch, self.mode)] |
| 71 | source = open(self.file, encoding='utf8').read() |
| 72 | flags_match = FLAGS_PATTERN.search(source) |
| 73 | envs = self._parse_source_env(source) |
| 74 | if flags_match: |
| 75 | flags = flags_match.group(1).strip().split() |
| 76 | # The following block reads config.gypi to extract the v8_enable_inspector |
| 77 | # value. This is done to check if the inspector is disabled in which case |
| 78 | # the '--inspect' flag cannot be passed to the node process as it will |
| 79 | # cause node to exit and report the test as failed. The use case |
| 80 | # is currently when Node is configured --without-ssl and the tests should |
| 81 | # still be runnable but skip any tests that require ssl (which includes the |
| 82 | # inspector related tests). Also, if there is no ssl support the options |
| 83 | # '--use-bundled-ca', '--use-system-ca' and '--use-openssl-ca' will also |
| 84 | # cause a similar failure so such tests are also skipped. |
| 85 | if (any(flag.startswith('--inspect') for flag in flags) and |
| 86 | not self.context.v8_enable_inspector): |
| 87 | print(': Skipping as node was compiled without inspector support') |
| 88 | elif (('--use-bundled-ca' in flags or |
| 89 | '--use-openssl-ca' in flags or |
| 90 | '--use-system-ca' in flags or |
| 91 | '--no-use-bundled-ca' in flags or |
| 92 | '--no-use-openssl-ca' in flags or |
| 93 | '--no-use-system-ca' in flags or |
| 94 | '--tls-v1.0' in flags or |
| 95 | '--tls-v1.1' in flags) and |
| 96 | not self.context.node_has_crypto): |
| 97 | # TODO(joyeecheung): add this to the status file variables so that we can |
| 98 | # list the crypto dependency in the status files explicitly instead. |
| 99 | print(': Skipping as node was compiled without crypto support') |
| 100 | elif (('--experimental-ffi' in flags or |
| 101 | '--no-experimental-ffi' in flags or |
| 102 | '--allow-ffi' in flags) and |
| 103 | not self.context.node_has_ffi): |
| 104 | print(': Skipping as node was compiled without FFI support') |
| 105 | else: |
| 106 | result += flags |
| 107 | |
| 108 | rlimit_as_match = RLIMIT_AS_PATTERN.search(source) |
| 109 | if rlimit_as_match: |
| 110 | self.max_virtual_memory = int(rlimit_as_match.group(1)) |
| 111 | |
| 112 | if self.context.use_error_reporter and NODE_TEST_PATTERN.search(source): |
| 113 | result += ['--test-reporter=./test/common/test-error-reporter.js', |
| 114 | '--test-reporter-destination=stdout'] |
| 115 | |
| 116 | if self.additional_flags: |
| 117 | result += self.additional_flags |
| 118 | |
| 119 | result += [self.file] |
| 120 | |
| 121 | return { |
| 122 | 'command': result, |
| 123 | 'envs': envs |
| 124 | } |
| 125 | |
| 126 | def GetSource(self): |