Skip to content

Commit dd0a13a

Browse files
committed
fix: update benchmark test script
1 parent 60eea57 commit dd0a13a

File tree

4 files changed

+15
-4
lines changed

4 files changed

+15
-4
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ result.txt
1313
testing/main.c
1414
*/*compile_commands.json
1515
testing/benchmark_results.txt
16-
testing/test-examples/
16+
testing/test-examples/*
1717

1818
# Ignore Python wheel packages (clang-format, clang-tidy)
1919
clang-tidy-1*

testing/benchmark_hook_1.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v1.1.0
4+
hooks:
5+
- id: clang-format
6+
args: [--style=file, --version=21]

testing/benchmark_hook_2.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/mirrors-clang-format
3+
rev: v21.1.0
4+
hooks:
5+
- id: clang-format

testing/benchmark_hooks.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@
2121
HOOKS = [
2222
{
2323
"name": "cpp-linter-hooks",
24-
"config": "testing/pre-commit-config-cpp-linter-hooks.yaml",
24+
"config": "testing/benchmark_hook_1.yaml",
2525
},
2626
{
2727
"name": "mirrors-clang-format",
28-
"config": "testing/pre-commit-config-mirrors-clang-format.yaml",
28+
"config": "testing/benchmark_hook_2.yaml",
2929
},
3030
]
3131

@@ -84,7 +84,7 @@ def benchmark():
8484
results = {}
8585
for hook in HOOKS:
8686
times = []
87-
print(f"Benchmarking {hook['name']}...")
87+
print(f"\nBenchmarking {hook['name']}...")
8888
for i in range(REPEATS):
8989
safe_git_restore(TARGET_FILES)
9090
subprocess.run(["pre-commit", "clean"])

0 commit comments

Comments
 (0)