forked from facebook/hermes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
lit.cfg
80 lines (65 loc) · 3.39 KB
/
lit.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
import lit
import sys
def isTrue(v):
"""Check whether a string converts to True according to CMake rules"""
return v.upper() in ["1", "ON", "YES", "TRUE", "Y"]
# name: The name of this test suite.
config.name = 'Hermes'
config.test_format = lit.formats.ShTest(True)
# suffixes: A list of file extensions to treat as test files.
config.suffixes = ['.js']
# If icu_data is present and not empty
if lit_config.params.get("icu_data"):
config.environment["ICU_DATA"] = lit_config.params["icu_data"]
# Optionally execute in a different directory so the output files stay there.
if "test_exec_root" in lit_config.params:
config.test_exec_root=lit_config.params["test_exec_root"]
if isTrue(lit_config.params["debugger_enabled"]):
config.available_features.add("debugger")
if isTrue(lit_config.params["use_flowparser"]):
config.available_features.add("flowparser")
if isTrue(lit_config.params["jit_enabled"]):
config.available_features.add("jit")
if isTrue(lit_config.params["jit_disassembler_enabled"]):
config.available_features.add("jit_dis")
if isTrue(lit_config.params["exception_on_oom_enabled"]):
config.available_features.add("exception_on_oom")
if isTrue(lit_config.params['serialize_enabled']):
config.available_features.add("serializer")
if isTrue(lit_config.params["use_js_library_implementation"]):
config.available_features.add("jslib")
if lit_config.params["profiler"] == "BB":
config.available_features.add("basic_block_profiler")
if lit_config.params["build_mode"] != "opt":
config.available_features.add("debug_options")
if lit_config.params["build_mode"] == "dbg":
config.available_features.add("slow_debug")
if isTrue(lit_config.params.get("is_fbcode", "")):
config.available_features.add("fbcode")
if isTrue(lit_config.params["ubsan"]):
config.available_features.add("ubsan")
if sys.platform.startswith('cygwin'):
lit_config.fatal('Running Hermes LIT tests in cygwin Python is not supported. ' +
'When running LIT tests on Windows, please use regular Python.')
if lit_config.isWindows:
config.available_features.add("windows")
if not lit_config.getBashPath:
lit_config.fatal('Running Hermes LIT tests in CMD.exe is not supported. ' +
'When running LIT tests on Windows, please make sure bash is available. ' +
'For example, you may invoke the test in cygwin, or add bash to your PATH.')
if lit_config.params["gc"] == "NONCONTIG_GENERATIONAL":
config.available_features.add("gengc")
# Note
# 1. substitutions are applied in order.
# %hermesc must appear before %hermes, or else %hermes will substitute *inside* %hermesc
# 2. \ are replaced with /.
# On Windows, paths may be separated by either \ or /.
# However, when path containing \ are substituted into RUN line, it's not automatically
# escaped, and does not work.
config.substitutions.append(("%FileCheck", lit_config.params["FileCheck"].replace('\\', '/')))
config.substitutions.append(("%hermesc", lit_config.params["hermesc"].replace('\\', '/')))
config.substitutions.append(("%hermes", lit_config.params["hermes"].replace('\\', '/')))
config.substitutions.append(("%hdb", lit_config.params["hdb"].replace('\\', '/')))
config.substitutions.append(("%hbcdump", lit_config.params["hbcdump"].replace('\\', '/')))
config.substitutions.append(("%hbc-deltaprep", lit_config.params["hbc_deltaprep"].replace('\\', '/')))
config.substitutions.append(("%hbc-diff", lit_config.params["hbc_diff"].replace('\\', '/')))