1
1
#! /bin/bash
2
2
# 2 Failed cases are expected
3
+ echo " ==========================="
4
+ echo " Test pre-commit-config.yaml"
5
+ echo " ==========================="
3
6
pre-commit clean
4
7
pre-commit run -c testing/pre-commit-config.yaml --files testing/main.c | tee -a result.txt || true
5
8
git restore testing/main.c
6
9
7
10
# 10 Failed cases are expected
11
+ echo " ===================================="
12
+ echo " Test pre-commit-config-version.yaml"
13
+ echo " ===================================="
8
14
pre-commit clean
9
15
pre-commit run -c testing/pre-commit-config-version.yaml --files testing/main.c | tee -a result.txt || true
10
16
git restore testing/main.c
11
- cat result.txt
12
17
13
18
# 2 Failed cases are expected
19
+ echo " ===================================="
20
+ echo " Test pre-commit-config-verbose.yaml"
21
+ echo " ===================================="
14
22
pre-commit clean
15
23
pre-commit run -c testing/pre-commit-config-verbose.yaml --files testing/main.c | tee -a result.txt || true
16
24
git restore testing/main.c
25
+
26
+ echo " ===================================="
27
+ echo " print result.txt"
17
28
cat result.txt
29
+ echo " ===================================="
18
30
19
31
failed_cases=` grep -c " Failed" result.txt`
20
32
@@ -24,8 +36,8 @@ if [ $failed_cases -eq 10 ]; then
24
36
echo " =============================="
25
37
echo " Test cpp-linter-hooks success."
26
38
echo " =============================="
27
- exit 0
28
39
rm result.txt
40
+ exit 0
29
41
else
30
42
echo " ============================="
31
43
echo " Test cpp-linter-hooks failed."
0 commit comments