-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathlit.cfg.py
More file actions
49 lines (36 loc) · 1.34 KB
/
lit.cfg.py
File metadata and controls
49 lines (36 loc) · 1.34 KB
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
import os
from typing import Any
import lit.formats
config: Any
lit_config: Any
config.name = "html2pdf4doc Python API integration tests"
config.test_format = lit.formats.ShTest("0")
current_dir = os.getcwd().replace("\\", "/")
html2pdf_exec = lit_config.params["HTML2PDF4DOC_EXEC"]
assert html2pdf_exec
config.substitutions.append(("%project_root", current_dir))
config.substitutions.append(("%html2pdf", html2pdf_exec))
config.substitutions.append(
(
"%check_exists",
'python "{}/tests/integration/check_exists.py"'.format(current_dir),
)
)
config.substitutions.append(
(
"%expect_exit",
'python "{}/tests/integration/expect_exit.py"'.format(current_dir),
)
)
config.suffixes = [".itest", ".c"]
config.is_windows = lit_config.isWindows
if not lit_config.isWindows:
config.available_features.add("PLATFORM_IS_NOT_WINDOWS")
is_full_test = lit_config.params.get("HTML2PDF4DOC_FULL_TEST", False)
if is_full_test:
config.available_features.add("FULL_TEST")
# In Linux CI, $HOME is required for Chrome as it needs to access things in ~/.local
config.environment["HOME"] = os.environ.get("HOME", "/tmp")
# In Windows CI, %ProgramW6432% is required for Selenium to properly detect browsers
config.environment["ProgramW6432"] = os.environ.get("ProgramW6432", "")
config.environment["PYTHONPATH"] = current_dir