Style: Integrate #pragma once in builders/checks

This commit is contained in:
Thaddeus Crews 2025-02-01 10:11:55 -06:00
parent 7459a0361d
commit 96fdaa616b
No known key found for this signature in database
GPG key ID: 62181B86FE9E5D84
17 changed files with 44 additions and 197 deletions

View file

@ -78,8 +78,7 @@ def main():
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#ifndef TEST_{name_upper_snake_case}_H
#define TEST_{name_upper_snake_case}_H
#pragma once
#include "tests/test_macros.h"
@ -90,14 +89,11 @@ TEST_CASE("[{name_pascal_case}] Example test case") {{
}}
}} // namespace Test{name_pascal_case}
#endif // TEST_{name_upper_snake_case}_H
""".format(
name_snake_case=name_snake_case,
# Capitalize the first letter but keep capitalization for the rest of the string.
# This is done in case the user passes a camelCase string instead of PascalCase.
name_pascal_case=args.name[0].upper() + args.name[1:],
name_upper_snake_case=name_snake_case.upper(),
# The padding length depends on the test name length.
padding=" " * (61 - len(name_snake_case)),
)