Skip to content

Commit f318463

Browse files
aaryanshuklayuxuanchen1997
authored andcommitted
[libc] newheadergen: adding h_def_file arg to test (#99397)
Summary: - spacing with _NOEXCEPT Test Plan: Reviewers: Subscribers: Tasks: Tags: Differential Revision: https://phabricator.intern.facebook.com/D60250986
1 parent 4b5c7e4 commit f318463

File tree

4 files changed

+6
-57
lines changed

4 files changed

+6
-57
lines changed

libc/newhdrgen/class_implementation/classes/function.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def __str__(self):
2626
attributes_str = " ".join(self.attributes)
2727
arguments_str = ", ".join(self.arguments)
2828
if attributes_str == "":
29-
result = f"{self.return_type} {self.name}({arguments_str});"
29+
result = f"{self.return_type} {self.name}({arguments_str})"
3030
else:
3131
result = f"{attributes_str} {self.return_type} {self.name}({arguments_str})"
3232
return result

libc/newhdrgen/header.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,24 +60,24 @@ def __str__(self):
6060
current_guard = None
6161
for function in self.functions:
6262
if function.guard == None:
63-
content.append(str(function) + "__NOEXCEPT")
63+
content.append(str(function) + " __NOEXCEPT;")
6464
content.append("")
6565
else:
6666
if current_guard == None:
6767
current_guard = function.guard
6868
content.append(f"#ifdef {current_guard}")
69-
content.append(str(function) + "__NOEXCEPT")
69+
content.append(str(function) + " __NOEXCEPT;")
7070
content.append("")
7171
elif current_guard == function.guard:
72-
content.append(str(function) + "__NOEXCEPT")
72+
content.append(str(function) + " __NOEXCEPT;")
7373
content.append("")
7474
else:
7575
content.pop()
7676
content.append(f"#endif // {current_guard}")
7777
content.append("")
7878
current_guard = function.guard
7979
content.append(f"#ifdef {current_guard}")
80-
content.append(str(function) + "__NOEXCEPT")
80+
content.append(str(function) + " __NOEXCEPT;")
8181
content.append("")
8282
if current_guard != None:
8383
content.pop()

libc/newhdrgen/tests/output/test_small.h

Lines changed: 0 additions & 52 deletions
This file was deleted.

libc/newhdrgen/tests/test_integration.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ def run_script(self, yaml_file, h_def_file, output_dir):
2525
"python3",
2626
str(self.source_dir / "libc/newhdrgen/yaml_to_classes.py"),
2727
str(yaml_file),
28+
"--h_def_file",
2829
str(h_def_file),
2930
"--output_dir",
3031
str(output_dir),

0 commit comments

Comments
 (0)