From e98560a349f3381c8fc6ecb6bf149c337dcf17be Mon Sep 17 00:00:00 2001 From: Gagbo Date: Sat, 24 Jun 2017 13:38:16 +0200 Subject: Added builddir option to clang-tidy to point to json folder (#688) Detect compille_commands.json files for clang-tidy --- test/test_c_import_paths.vader | 15 +++++++++++++++ test/test_c_projects/build/bad_folder_to_test_priority | 0 test/test_c_projects/build/compile_commands.json | 0 .../json_project/build/compile_commands.json | 0 test/test_c_projects/json_project/include/test.h | 0 test/test_c_projects/json_project/subdir/dummy | 0 6 files changed, 15 insertions(+) create mode 100644 test/test_c_projects/build/bad_folder_to_test_priority create mode 100644 test/test_c_projects/build/compile_commands.json create mode 100644 test/test_c_projects/json_project/build/compile_commands.json create mode 100644 test/test_c_projects/json_project/include/test.h create mode 100644 test/test_c_projects/json_project/subdir/dummy (limited to 'test') diff --git a/test/test_c_import_paths.vader b/test/test_c_import_paths.vader index 66ff6dca..b867100a 100644 --- a/test/test_c_import_paths.vader +++ b/test/test_c_import_paths.vader @@ -226,3 +226,18 @@ Execute(The C++ Clang handler should include root directories for projects with \ . ' -I' . ale#Escape(g:dir . '/test_c_projects/hpp_file_project') . ' ' \ . ' -' \ , ale_linters#cpp#clang#GetCommand(bufnr('')) + +Execute(The C++ ClangTidy handler should include json folders for projects with suitable build directory in them): + runtime! ale_linters/cpp/clangtidy.vim + + cd test_c_projects/json_project/subdir + silent noautocmd file file.cpp + + " TODO Test to move to C-family tools tests + " AssertEqual + " \ '/testplugin/test/test_c_projects/json_project/build' + " \ , ale#c#FindCompileCommands(bufnr('')) + + AssertEqual + \ 'clang-tidy -checks=''*'' %s -p ''/testplugin/test/test_c_projects/json_project/build''' + \ , ale_linters#cpp#clangtidy#GetCommand(bufnr('')) diff --git a/test/test_c_projects/build/bad_folder_to_test_priority b/test/test_c_projects/build/bad_folder_to_test_priority new file mode 100644 index 00000000..e69de29b diff --git a/test/test_c_projects/build/compile_commands.json b/test/test_c_projects/build/compile_commands.json new file mode 100644 index 00000000..e69de29b diff --git a/test/test_c_projects/json_project/build/compile_commands.json b/test/test_c_projects/json_project/build/compile_commands.json new file mode 100644 index 00000000..e69de29b diff --git a/test/test_c_projects/json_project/include/test.h b/test/test_c_projects/json_project/include/test.h new file mode 100644 index 00000000..e69de29b diff --git a/test/test_c_projects/json_project/subdir/dummy b/test/test_c_projects/json_project/subdir/dummy new file mode 100644 index 00000000..e69de29b -- cgit v1.2.3