-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtest_parse_standard_library_includes.py
More file actions
52 lines (47 loc) · 1 KB
/
test_parse_standard_library_includes.py
File metadata and controls
52 lines (47 loc) · 1 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
50
51
52
import pytest
from clang.cindex import TranslationUnit
import py_cppmodel
COMPILER_ARGS = [
"-x",
"c++",
"-std=c++20",
"-I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1",
"-I/Library/Developer/CommandLineTools/usr/include",
]
@pytest.mark.parametrize(
"include",
[
"algorithm",
"any",
"array",
"deque",
"forward_list",
"functional",
"iterator",
"list",
"map",
"memory",
"numeric",
"optional",
"queue",
"set",
"stack",
"string",
"tuple",
"type_traits",
"unordered_map",
"unordered_set",
"utility",
"variant",
"vector",
],
)
def test_include(include):
source = f"#include <{include}>"
tu = TranslationUnit.from_source(
"t.cc",
COMPILER_ARGS,
unsaved_files=[("t.cc", source)],
)
# This should not raise an exception.
py_cppmodel.Model(tu)