File tree Expand file tree Collapse file tree 1 file changed +16
-7
lines changed Expand file tree Collapse file tree 1 file changed +16
-7
lines changed Original file line number Diff line number Diff line change 1
- rm -f result.txt
1
+ #! /bin/bash
2
+ # 2 Failed cases are expected
3
+ pre-commit clean
4
+ pre-commit run -c testing/pre-commit-config.yaml --files testing/main.c | tee -a result.txt || true
2
5
git restore testing/main.c
3
6
4
- for config in testing/pre-commit-config.yaml testing/pre-commit-config-version.yaml testing/pre-commit-config-verbose.yaml; do
5
- pre-commit clean
6
- pre-commit run -c $config --files testing/main.c | tee -a result.txt || true
7
- git restore testing/main.c
8
- done
7
+ # 10 Failed cases are expected
8
+ pre-commit clean
9
+ pre-commit run -c testing/pre-commit-config-version.yaml --files testing/main.c | tee -a result.txt || true
10
+ git restore testing/main.c
11
+ cat result.txt
12
+
13
+ # 2 Failed cases are expected
14
+ pre-commit clean
15
+ pre-commit run -c testing/pre-commit-config-verbose.yaml --files testing/main.c | tee -a result.txt || true
16
+ git restore testing/main.c
17
+ cat result.txt
9
18
10
19
failed_cases=` grep -c " Failed" result.txt`
11
20
12
21
echo $failed_cases " cases failed."
13
22
14
- if [ $failed_cases -eq 9 ]; then
23
+ if [ $failed_cases -eq 10 ]; then
15
24
echo " =============================="
16
25
echo " Test cpp-linter-hooks success."
17
26
echo " =============================="
You can’t perform that action at this time.
0 commit comments