diff --git a/testing/.clang-tidy b/testing/.clang-tidy index 36fb3ab..77d52bd 100644 --- a/testing/.clang-tidy +++ b/testing/.clang-tidy @@ -2,7 +2,6 @@ Checks: 'clang-diagnostic-*,clang-analyzer-*,-*,performance-*,bugprone-*,clang-analyzer-*,mpi-*,misc-*,readability-*' WarningsAsErrors: '' HeaderFilterRegex: '' -AnalyzeTemporaryDtors: false FormatStyle: 'file' CheckOptions: - key: bugprone-argument-comment.CommentBoolLiterals diff --git a/testing/pre-commit-config-version.yaml b/testing/pre-commit-config-version.yaml index 5b7b9b9..dbb8f55 100644 --- a/testing/pre-commit-config-version.yaml +++ b/testing/pre-commit-config-version.yaml @@ -6,3 +6,31 @@ repos: args: [--style=file, --version=16] # to load .clang-format - id: clang-tidy args: [--checks=.clang-tidy, --version=16] # path/to/.clang-tidy + - repo: . + rev: HEAD + hooks: + - id: clang-format + args: [--style=file, --version=17] + - id: clang-tidy + args: [--checks=.clang-tidy, --version=17] + - repo: . + rev: HEAD + hooks: + - id: clang-format + args: [--style=file, --version=18] + - id: clang-tidy + args: [--checks=.clang-tidy, --version=18] + - repo: . + rev: HEAD + hooks: + - id: clang-format + args: [--style=file, --version=19] + - id: clang-tidy + args: [--checks=.clang-tidy, --version=19] + - repo: . + rev: HEAD + hooks: + - id: clang-format + args: [--style=file, --version=20] + - id: clang-tidy + args: [--checks=.clang-tidy, --version=20] diff --git a/testing/run.sh b/testing/run.sh index 7a88fcc..34725f1 100644 --- a/testing/run.sh +++ b/testing/run.sh @@ -9,7 +9,9 @@ done failed_cases=`grep -c "Failed" result.txt` -if [ $failed_cases -eq 4 ]; then +echo $failed_cases " cases failed." + +if [ $failed_cases -eq 9 ]; then echo "==============================" echo "Test cpp-linter-hooks success." echo "==============================" diff --git a/tests/test_clang_format.py b/tests/test_clang_format.py index 7a1b7b7..ac26881 100644 --- a/tests/test_clang_format.py +++ b/tests/test_clang_format.py @@ -8,6 +8,10 @@ ('args', 'expected_retval'), ( (['--style=Google'], (0, "")), (['--style=Google', '--version=16'], (0, "")), + (['--style=Google', '--version=17'], (0, "")), + (['--style=Google', '--version=18'], (0, "")), + (['--style=Google', '--version=19'], (0, "")), + (['--style=Google', '--version=20'], (0, "")), ), ) def test_run_clang_format_valid(args, expected_retval, tmp_path): @@ -23,6 +27,10 @@ def test_run_clang_format_valid(args, expected_retval, tmp_path): ('args', 'expected_retval'), ( (['--style=Google',], 1), (['--style=Google', '--version=16'], 1), + (['--style=Google', '--version=17'], 1), + (['--style=Google', '--version=18'], 1), + (['--style=Google', '--version=19'], 1), + (['--style=Google', '--version=20'], 1), ), ) def test_run_clang_format_invalid(args, expected_retval, tmp_path): diff --git a/tests/test_clang_tidy.py b/tests/test_clang_tidy.py index a62203b..cb6fbaf 100644 --- a/tests/test_clang_tidy.py +++ b/tests/test_clang_tidy.py @@ -16,6 +16,10 @@ def generate_compilation_database(): ('args', 'expected_retval'), ( (['--checks="boost-*"'], 1), (['--checks="boost-*"', '--version=16'], 1), + (['--checks="boost-*"', '--version=17'], 1), + (['--checks="boost-*"', '--version=18'], 1), + (['--checks="boost-*"', '--version=19'], 1), + (['--checks="boost-*"', '--version=20'], 1), ), ) def test_run_clang_tidy_valid(args, expected_retval): @@ -31,6 +35,10 @@ def test_run_clang_tidy_valid(args, expected_retval): ('args', 'expected_retval'), ( (['--checks="boost-*"'], 1), (['--checks="boost-*"', '--version=16'], 1), + (['--checks="boost-*"', '--version=17'], 1), + (['--checks="boost-*"', '--version=18'], 1), + (['--checks="boost-*"', '--version=19'], 1), + (['--checks="boost-*"', '--version=20'], 1), ), ) def test_run_clang_tidy_invalid(args, expected_retval, tmp_path):