forked from facebook/hermes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
lit.cfg
92 lines (76 loc) · 3.87 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
81
82
83
84
85
86
87
88
89
90
91
92
import lit
import os
import sys
def isTrue(v):
"""Check whether a string converts to True according to CMake rules"""
return v and 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"]
if lit_config.params.get("coverage"):
# It would be best to prefix these with the specific binary tool used
# but there's no way to get that from here.
config.environment["LLVM_PROFILE_FILE"] = os.path.join(
lit_config.params["coverage"],
"hermes-%p.profraw",
)
# 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.get("debugger_enabled")):
config.available_features.add("debugger")
if isTrue(lit_config.params.get("use_flowparser")):
config.available_features.add("flowparser")
if isTrue(lit_config.params.get("exception_on_oom_enabled")):
config.available_features.add("exception_on_oom")
if isTrue(lit_config.params.get('serialize_enabled')):
config.available_features.add("serializer")
if lit_config.params.get("profiler") == "BB":
config.available_features.add("basic_block_profiler")
if lit_config.params.get("build_mode") != "opt":
config.available_features.add("debug_options")
if lit_config.params.get("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.get("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.get("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.
if lit_config.params.get("FileCheck"):
config.substitutions.append(("%FileCheck", lit_config.params["FileCheck"].replace('\\', '/')))
if lit_config.params.get("hermesc"):
config.substitutions.append(("%hermesc", lit_config.params["hermesc"].replace('\\', '/')))
if lit_config.params.get("hermes"):
config.substitutions.append(("%hermes", lit_config.params["hermes"].replace('\\', '/')))
if lit_config.params.get("hdb"):
config.substitutions.append(("%hdb", lit_config.params["hdb"].replace('\\', '/')))
if lit_config.params.get("hbcdump"):
config.substitutions.append(("%hbcdump", lit_config.params["hbcdump"].replace('\\', '/')))
if lit_config.params.get("hbc_deltaprep"):
config.substitutions.append(("%hbc-deltaprep", lit_config.params["hbc_deltaprep"].replace('\\', '/')))
if lit_config.params.get("hbc_diff"):
config.substitutions.append(("%hbc-diff", lit_config.params["hbc_diff"].replace('\\', '/')))
if lit_config.params.get("dependency_extractor"):
config.substitutions.append(("%dependency-extractor", lit_config.params["dependency_extractor"].replace('\\', '/')))