Skip to content

Commit ee23d5c

Browse files
committed
update testing run.sh
1 parent 63bef2d commit ee23d5c

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

testing/run.sh

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,26 @@
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
25
git restore testing/main.c
36

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
918

1019
failed_cases=`grep -c "Failed" result.txt`
1120

1221
echo $failed_cases " cases failed."
1322

14-
if [ $failed_cases -eq 9 ]; then
23+
if [ $failed_cases -eq 10 ]; then
1524
echo "=============================="
1625
echo "Test cpp-linter-hooks success."
1726
echo "=============================="

0 commit comments

Comments
 (0)