-
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathrun.sh
More file actions
43 lines (37 loc) · 1.43 KB
/
run.sh
File metadata and controls
43 lines (37 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash
echo "==========================="
echo "Test pre-commit-config.yaml"
echo "==========================="
pre-commit clean
pre-commit run -c testing/pre-commit-config.yaml --files testing/main.c | tee -a result.txt || true
git restore testing/main.c
echo "===================================="
echo "Test pre-commit-config-version.yaml"
echo "===================================="
pre-commit clean
pre-commit run -c testing/pre-commit-config-version.yaml --files testing/main.c | tee -a result.txt || true
git restore testing/main.c
echo "===================================="
echo "Test pre-commit-config-verbose.yaml"
echo "===================================="
pre-commit clean
pre-commit run -c testing/pre-commit-config-verbose.yaml --files testing/main.c | tee -a result.txt || true
git restore testing/main.c
echo "=================================================================================="
echo "print result.txt"
cat result.txt
echo "=================================================================================="
failed_cases=`grep -c "Failed" result.txt`
echo $failed_cases " cases failed."
if [ $failed_cases -eq 10 ]; then
echo "=============================="
echo "Test cpp-linter-hooks success."
echo "=============================="
rm result.txt
exit 0
else
echo "============================="
echo "Test cpp-linter-hooks failed."
echo "============================="
exit 1
fi