Browse Source

Renamed C++ header and source files to use proper C++ file extensions.

pipelines/235045657
eidheim 6 years ago
parent
commit
480430ed16
  1. 72
      src/CMakeLists.txt
  2. 4
      src/autocomplete.cpp
  3. 6
      src/autocomplete.hpp
  4. 12
      src/cmake.cpp
  5. 0
      src/cmake.hpp
  6. 6
      src/compile_commands.cpp
  7. 0
      src/compile_commands.hpp
  8. 8
      src/config.cpp
  9. 2
      src/config.hpp
  10. 10
      src/ctags.cpp
  11. 0
      src/ctags.hpp
  12. 8
      src/debug_lldb.cpp
  13. 2
      src/debug_lldb.hpp
  14. 2
      src/dialogs.cpp
  15. 0
      src/dialogs.hpp
  16. 2
      src/dialogs_unix.cpp
  17. 6
      src/dialogs_win.cpp
  18. 14
      src/directories.cpp
  19. 4
      src/directories.hpp
  20. 2
      src/dispatcher.cpp
  21. 2
      src/dispatcher.hpp
  22. 2
      src/documentation.cpp
  23. 0
      src/documentation.hpp
  24. 2
      src/entrybox.cpp
  25. 2
      src/entrybox.hpp
  26. 0
      src/files.hpp
  27. 2
      src/filesystem.cpp
  28. 0
      src/filesystem.hpp
  29. 2
      src/git.cpp
  30. 2
      src/git.hpp
  31. 10
      src/grep.cpp
  32. 0
      src/grep.hpp
  33. 2
      src/info.cpp
  34. 0
      src/info.hpp
  35. 20
      src/juci.cpp
  36. 0
      src/juci.hpp
  37. 4
      src/menu.cpp
  38. 0
      src/menu.hpp
  39. 12
      src/meson.cpp
  40. 0
      src/meson.hpp
  41. 0
      src/mutex.hpp
  42. 18
      src/notebook.cpp
  43. 4
      src/notebook.hpp
  44. 32
      src/project.cpp
  45. 6
      src/project.hpp
  46. 6
      src/project_build.cpp
  47. 4
      src/project_build.hpp
  48. 2
      src/selection_dialog.cpp
  49. 2
      src/selection_dialog.hpp
  50. 8
      src/snippets.cpp
  51. 0
      src/snippets.hpp
  52. 22
      src/source.cpp
  53. 6
      src/source.hpp
  54. 16
      src/source_base.cpp
  55. 4
      src/source_base.hpp
  56. 26
      src/source_clang.cpp
  57. 10
      src/source_clang.hpp
  58. 10
      src/source_diff.cpp
  59. 8
      src/source_diff.hpp
  60. 12
      src/source_generic.cpp
  61. 6
      src/source_generic.hpp
  62. 20
      src/source_language_protocol.cpp
  63. 6
      src/source_language_protocol.hpp
  64. 8
      src/source_spellcheck.cpp
  65. 2
      src/source_spellcheck.hpp
  66. 12
      src/terminal.cpp
  67. 8
      src/terminal.hpp
  68. 12
      src/tooltips.cpp
  69. 2
      src/tooltips.hpp
  70. 12
      src/usages_clang.cpp
  71. 2
      src/usages_clang.hpp
  72. 2
      src/utility.cpp
  73. 0
      src/utility.hpp
  74. 30
      src/window.cpp
  75. 2
      src/window.hpp
  76. 0
      src/window_macos.hpp
  77. 44
      tests/CMakeLists.txt
  78. 18
      tests/cmake_build_test.cpp
  79. 2
      tests/compile_commands_test.cpp
  80. 40
      tests/ctags_grep_test.cpp
  81. 2
      tests/filesystem_test.cpp
  82. 6
      tests/git_test.cpp
  83. 2
      tests/lldb_test.cpp
  84. 4
      tests/meson_build_test.cpp
  85. 0
      tests/process_test.cpp
  86. 6
      tests/source_clang_test.cpp
  87. 2
      tests/source_generic_test.cpp
  88. 4
      tests/source_key_test.cpp
  89. 4
      tests/source_test.cpp
  90. 3
      tests/stubs/config.cc
  91. 3
      tests/stubs/config.cpp
  92. 2
      tests/stubs/dialogs.cpp
  93. 2
      tests/stubs/directories.cpp
  94. 2
      tests/stubs/info.cpp
  95. 2
      tests/stubs/notebook.cpp
  96. 2
      tests/stubs/project.cpp
  97. 2
      tests/stubs/selection_dialog.cpp
  98. 2
      tests/terminal_test.cpp
  99. 2
      tests/tooltips_test.cpp
  100. 8
      tests/usages_clang_test.cpp

72
src/CMakeLists.txt

@ -1,32 +1,32 @@
# Files used both in ../src and ../tests # Files used both in ../src and ../tests
set(JUCI_SHARED_FILES set(JUCI_SHARED_FILES
autocomplete.cc autocomplete.cpp
cmake.cc cmake.cpp
compile_commands.cc compile_commands.cpp
ctags.cc ctags.cpp
dispatcher.cc dispatcher.cpp
documentation.cc documentation.cpp
filesystem.cc filesystem.cpp
git.cc git.cpp
grep.cc grep.cpp
menu.cc menu.cpp
meson.cc meson.cpp
project_build.cc project_build.cpp
snippets.cc snippets.cpp
source.cc source.cpp
source_base.cc source_base.cpp
source_clang.cc source_clang.cpp
source_diff.cc source_diff.cpp
source_generic.cc source_generic.cpp
source_language_protocol.cc source_language_protocol.cpp
source_spellcheck.cc source_spellcheck.cpp
terminal.cc terminal.cpp
tooltips.cc tooltips.cpp
usages_clang.cc usages_clang.cpp
utility.cc utility.cpp
) )
if(LIBLLDB_FOUND) if(LIBLLDB_FOUND)
list(APPEND JUCI_SHARED_FILES debug_lldb.cc) list(APPEND JUCI_SHARED_FILES debug_lldb.cpp)
endif() endif()
add_library(juci_shared STATIC ${JUCI_SHARED_FILES}) add_library(juci_shared STATIC ${JUCI_SHARED_FILES})
target_link_libraries(juci_shared target_link_libraries(juci_shared
@ -42,17 +42,17 @@ target_link_libraries(juci_shared
) )
set(JUCI_FILES set(JUCI_FILES
config.cc config.cpp
dialogs.cc dialogs.cpp
dialogs_unix.cc dialogs_unix.cpp
directories.cc directories.cpp
entrybox.cc entrybox.cpp
info.cc info.cpp
juci.cc juci.cpp
notebook.cc notebook.cpp
project.cc project.cpp
selection_dialog.cc selection_dialog.cpp
window.cc window.cpp
) )
if(APPLE) if(APPLE)
list(APPEND JUCI_FILES window_macos.m) list(APPEND JUCI_FILES window_macos.m)

4
src/autocomplete.cc → src/autocomplete.cpp

@ -1,5 +1,5 @@
#include "autocomplete.h" #include "autocomplete.hpp"
#include "selection_dialog.h" #include "selection_dialog.hpp"
Autocomplete::Autocomplete(Gtk::TextView *view, bool &interactive_completion, guint &last_keyval, bool pass_buffer_and_strip_word) Autocomplete::Autocomplete(Gtk::TextView *view, bool &interactive_completion, guint &last_keyval, bool pass_buffer_and_strip_word)
: view(view), interactive_completion(interactive_completion), pass_buffer_and_strip_word(pass_buffer_and_strip_word) { : view(view), interactive_completion(interactive_completion), pass_buffer_and_strip_word(pass_buffer_and_strip_word) {

6
src/autocomplete.h → src/autocomplete.hpp

@ -1,7 +1,7 @@
#pragma once #pragma once
#include "dispatcher.h" #include "dispatcher.hpp"
#include "mutex.h" #include "mutex.hpp"
#include "tooltips.h" #include "tooltips.hpp"
#include <atomic> #include <atomic>
#include <thread> #include <thread>

12
src/cmake.cc → src/cmake.cpp

@ -1,9 +1,9 @@
#include "cmake.h" #include "cmake.hpp"
#include "compile_commands.h" #include "compile_commands.hpp"
#include "config.h" #include "config.hpp"
#include "dialogs.h" #include "dialogs.hpp"
#include "filesystem.h" #include "filesystem.hpp"
#include "terminal.h" #include "terminal.hpp"
#include <regex> #include <regex>
CMake::CMake(const boost::filesystem::path &path) { CMake::CMake(const boost::filesystem::path &path) {

0
src/cmake.h → src/cmake.hpp

6
src/compile_commands.cc → src/compile_commands.cpp

@ -1,7 +1,7 @@
#include "compile_commands.h" #include "compile_commands.hpp"
#include "clangmm.h" #include "clangmm.h"
#include "config.h" #include "config.hpp"
#include "terminal.h" #include "terminal.hpp"
#include <algorithm> #include <algorithm>
#include <boost/property_tree/json_parser.hpp> #include <boost/property_tree/json_parser.hpp>
#include <regex> #include <regex>

0
src/compile_commands.h → src/compile_commands.hpp

8
src/config.cc → src/config.cpp

@ -1,7 +1,7 @@
#include "config.h" #include "config.hpp"
#include "files.h" #include "files.hpp"
#include "filesystem.h" #include "filesystem.hpp"
#include "terminal.h" #include "terminal.hpp"
#include <algorithm> #include <algorithm>
#include <exception> #include <exception>
#include <iostream> #include <iostream>

2
src/config.h → src/config.hpp

@ -1,5 +1,5 @@
#pragma once #pragma once
#include "dispatcher.h" #include "dispatcher.hpp"
#include <boost/filesystem.hpp> #include <boost/filesystem.hpp>
#include <boost/property_tree/json_parser.hpp> #include <boost/property_tree/json_parser.hpp>
#include <string> #include <string>

10
src/ctags.cc → src/ctags.cpp

@ -1,8 +1,8 @@
#include "ctags.h" #include "ctags.hpp"
#include "config.h" #include "config.hpp"
#include "filesystem.h" #include "filesystem.hpp"
#include "project_build.h" #include "project_build.hpp"
#include "terminal.h" #include "terminal.hpp"
#include <climits> #include <climits>
#include <vector> #include <vector>

0
src/ctags.h → src/ctags.hpp

8
src/debug_lldb.cc → src/debug_lldb.cpp

@ -1,12 +1,12 @@
#include "debug_lldb.h" #include "debug_lldb.hpp"
#include <cstdio> #include <cstdio>
#ifdef __APPLE__ #ifdef __APPLE__
#include <cstdlib> #include <cstdlib>
#endif #endif
#include "config.h" #include "config.hpp"
#include "filesystem.h" #include "filesystem.hpp"
#include "process.hpp" #include "process.hpp"
#include "terminal.h" #include "terminal.hpp"
#include <boost/filesystem.hpp> #include <boost/filesystem.hpp>
#include <iostream> #include <iostream>

2
src/debug_lldb.h → src/debug_lldb.hpp

@ -1,5 +1,5 @@
#pragma once #pragma once
#include "mutex.h" #include "mutex.hpp"
#include <boost/filesystem.hpp> #include <boost/filesystem.hpp>
#include <list> #include <list>
#include <lldb/API/LLDB.h> #include <lldb/API/LLDB.h>

2
src/dialogs.cc → src/dialogs.cpp

@ -1,4 +1,4 @@
#include "dialogs.h" #include "dialogs.hpp"
#include <cmath> #include <cmath>
Dialog::Message::Message(const std::string &text) : Gtk::Window(Gtk::WindowType::WINDOW_POPUP) { Dialog::Message::Message(const std::string &text) : Gtk::Window(Gtk::WindowType::WINDOW_POPUP) {

0
src/dialogs.h → src/dialogs.hpp

2
src/dialogs_unix.cc → src/dialogs_unix.cpp

@ -1,4 +1,4 @@
#include "dialogs.h" #include "dialogs.hpp"
std::string Dialog::open_folder(const boost::filesystem::path &path) { std::string Dialog::open_folder(const boost::filesystem::path &path) {
return gtk_dialog(path, "Open Folder", return gtk_dialog(path, "Open Folder",

6
src/dialogs_win.cc → src/dialogs_win.cpp

@ -1,6 +1,6 @@
#include "dialogs.h" #include "dialogs.hpp"
#include "juci.h" #include "juci.hpp"
#include "singletons.h" #include "singletons.hpp"
#undef NTDDI_VERSION #undef NTDDI_VERSION
#define NTDDI_VERSION NTDDI_VISTA #define NTDDI_VERSION NTDDI_VISTA

14
src/directories.cc → src/directories.cpp

@ -1,10 +1,10 @@
#include "directories.h" #include "directories.hpp"
#include "entrybox.h" #include "entrybox.hpp"
#include "filesystem.h" #include "filesystem.hpp"
#include "notebook.h" #include "notebook.hpp"
#include "source.h" #include "source.hpp"
#include "terminal.h" #include "terminal.hpp"
#include "utility.h" #include "utility.hpp"
#include <algorithm> #include <algorithm>
bool Directories::TreeStore::row_drop_possible_vfunc(const Gtk::TreeModel::Path &path, const Gtk::SelectionData &selection_data) const { bool Directories::TreeStore::row_drop_possible_vfunc(const Gtk::TreeModel::Path &path, const Gtk::SelectionData &selection_data) const {

4
src/directories.h → src/directories.hpp

@ -1,7 +1,7 @@
#pragma once #pragma once
#include "boost/filesystem.hpp" #include "boost/filesystem.hpp"
#include "dispatcher.h" #include "dispatcher.hpp"
#include "git.h" #include "git.hpp"
#include <atomic> #include <atomic>
#include <gtkmm.h> #include <gtkmm.h>
#include <string> #include <string>

2
src/dispatcher.cc → src/dispatcher.cpp

@ -1,4 +1,4 @@
#include "dispatcher.h" #include "dispatcher.hpp"
#include <vector> #include <vector>
Dispatcher::Dispatcher() { Dispatcher::Dispatcher() {

2
src/dispatcher.h → src/dispatcher.hpp

@ -1,5 +1,5 @@
#pragma once #pragma once
#include "mutex.h" #include "mutex.hpp"
#include <functional> #include <functional>
#include <gtkmm.h> #include <gtkmm.h>
#include <list> #include <list>

2
src/documentation.cc → src/documentation.cpp

@ -1,4 +1,4 @@
#include "documentation.h" #include "documentation.hpp"
#include <unordered_map> #include <unordered_map>
std::string Documentation::CppReference::get_url(const std::string &symbol) noexcept { std::string Documentation::CppReference::get_url(const std::string &symbol) noexcept {

0
src/documentation.h → src/documentation.hpp

2
src/entrybox.cc → src/entrybox.cpp

@ -1,4 +1,4 @@
#include "entrybox.h" #include "entrybox.hpp"
std::unordered_map<std::string, std::vector<std::string>> EntryBox::entry_histories; std::unordered_map<std::string, std::vector<std::string>> EntryBox::entry_histories;

2
src/entrybox.h → src/entrybox.hpp

@ -1,6 +1,6 @@
#pragma once #pragma once
#include "gtkmm.h"
#include <functional> #include <functional>
#include <gtkmm.h>
#include <list> #include <list>
#include <string> #include <string>
#include <unordered_map> #include <unordered_map>

0
src/files.h → src/files.hpp

2
src/filesystem.cc → src/filesystem.cpp

@ -3,7 +3,7 @@
#include <iostream> #include <iostream>
#include <sstream> #include <sstream>
#include "filesystem.h" #include "filesystem.hpp"
//Only use on small files //Only use on small files
std::string filesystem::read(const std::string &path) { std::string filesystem::read(const std::string &path) {

0
src/filesystem.h → src/filesystem.hpp

2
src/git.cc → src/git.cpp

@ -1,4 +1,4 @@
#include "git.h" #include "git.hpp"
#include <cstring> #include <cstring>
#include <unordered_map> #include <unordered_map>

2
src/git.h → src/git.hpp

@ -1,5 +1,5 @@
#pragma once #pragma once
#include "mutex.h" #include "mutex.hpp"
#include <boost/filesystem.hpp> #include <boost/filesystem.hpp>
#include <giomm.h> #include <giomm.h>
#include <git2.h> #include <git2.h>

10
src/grep.cc → src/grep.cpp

@ -1,8 +1,8 @@
#include "grep.h" #include "grep.hpp"
#include "config.h" #include "config.hpp"
#include "filesystem.h" #include "filesystem.hpp"
#include "project_build.h" #include "project_build.hpp"
#include "terminal.h" #include "terminal.hpp"
Grep::Grep(const boost::filesystem::path &path, const std::string &pattern, bool case_sensitive, bool extended_regex) { Grep::Grep(const boost::filesystem::path &path, const std::string &pattern, bool case_sensitive, bool extended_regex) {
auto build = Project::Build::create(path); auto build = Project::Build::create(path);

0
src/grep.h → src/grep.hpp

2
src/info.cc → src/info.cpp

@ -1,4 +1,4 @@
#include "info.h" #include "info.hpp"
Info::Info() { Info::Info() {
set_hexpand(false); set_hexpand(false);

0
src/info.h → src/info.hpp

20
src/juci.cc → src/juci.cpp

@ -1,17 +1,17 @@
#include "juci.h" #include "juci.hpp"
#include "config.h" #include "config.hpp"
#include "directories.h" #include "directories.hpp"
#include "filesystem.h" #include "filesystem.hpp"
#include "menu.h" #include "menu.hpp"
#include "notebook.h" #include "notebook.hpp"
#include "terminal.h" #include "terminal.hpp"
#include "window.h" #include "window.hpp"
#ifndef _WIN32 #ifndef _WIN32
#include <csignal> #include <csignal>
#endif #endif
#ifdef __APPLE__ #ifdef __APPLE__
#include "dispatcher.h" #include "dispatcher.hpp"
#include "window_macos.h" #include "window_macos.hpp"
#endif #endif
int Application::on_command_line(const Glib::RefPtr<Gio::ApplicationCommandLine> &cmd) { int Application::on_command_line(const Glib::RefPtr<Gio::ApplicationCommandLine> &cmd) {

0
src/juci.h → src/juci.hpp

4
src/menu.cc → src/menu.cpp

@ -1,5 +1,5 @@
#include "menu.h" #include "menu.hpp"
#include "config.h" #include "config.hpp"
#include <iostream> #include <iostream>
#include <string> #include <string>

0
src/menu.h → src/menu.hpp

12
src/meson.cc → src/meson.cpp

@ -1,9 +1,9 @@
#include "meson.h" #include "meson.hpp"
#include "compile_commands.h" #include "compile_commands.hpp"
#include "config.h" #include "config.hpp"
#include "dialogs.h" #include "dialogs.hpp"
#include "filesystem.h" #include "filesystem.hpp"
#include "terminal.h" #include "terminal.hpp"
#include <regex> #include <regex>
Meson::Meson(const boost::filesystem::path &path) { Meson::Meson(const boost::filesystem::path &path) {

0
src/meson.h → src/meson.hpp

0
src/mutex.h → src/mutex.hpp

18
src/notebook.cc → src/notebook.cpp

@ -1,13 +1,13 @@
#include "notebook.h" #include "notebook.hpp"
#include "config.h" #include "config.hpp"
#include "filesystem.h" #include "filesystem.hpp"
#include "gtksourceview-3.0/gtksourceview/gtksourcemap.h" #include "project.hpp"
#include "project.h" #include "selection_dialog.hpp"
#include "selection_dialog.h" #include "source_clang.hpp"
#include "source_clang.h" #include "source_generic.hpp"
#include "source_generic.h" #include "source_language_protocol.hpp"
#include "source_language_protocol.h"
#include <fstream> #include <fstream>
#include <gtksourceview-3.0/gtksourceview/gtksourcemap.h>
#include <regex> #include <regex>
Notebook::TabLabel::TabLabel(const std::function<void()> &on_close) { Notebook::TabLabel::TabLabel(const std::function<void()> &on_close) {

4
src/notebook.h → src/notebook.hpp

@ -1,6 +1,6 @@
#pragma once #pragma once
#include "gtkmm.h" #include "source.hpp"
#include "source.h" #include <gtkmm.h>
#include <iostream> #include <iostream>
#include <map> #include <map>
#include <sigc++/sigc++.h> #include <sigc++/sigc++.h>

32
src/project.cc → src/project.cpp

@ -1,22 +1,22 @@
#include "project.h" #include "project.hpp"
#include "config.h" #include "config.hpp"
#include "directories.h" #include "directories.hpp"
#include "filesystem.h" #include "filesystem.hpp"
#include "menu.h" #include "menu.hpp"
#include "mutex.h" #include "mutex.hpp"
#include "notebook.h" #include "notebook.hpp"
#include "selection_dialog.h" #include "selection_dialog.hpp"
#include "terminal.h" #include "terminal.hpp"
#include <fstream> #include <fstream>
#ifdef JUCI_ENABLE_DEBUG #ifdef JUCI_ENABLE_DEBUG
#include "debug_lldb.h" #include "debug_lldb.hpp"
#endif #endif
#include "ctags.h" #include "ctags.hpp"
#include "info.h" #include "info.hpp"
#include "snippets.h" #include "snippets.hpp"
#include "source_clang.h" #include "source_clang.hpp"
#include "source_language_protocol.h" #include "source_language_protocol.hpp"
#include "usages_clang.h" #include "usages_clang.hpp"
#include <future> #include <future>
boost::filesystem::path Project::debug_last_stop_file_path; boost::filesystem::path Project::debug_last_stop_file_path;

6
src/project.h → src/project.hpp

@ -1,7 +1,7 @@
#pragma once #pragma once
#include "dispatcher.h" #include "dispatcher.hpp"
#include "project_build.h" #include "project_build.hpp"
#include "tooltips.h" #include "tooltips.hpp"
#include <atomic> #include <atomic>
#include <boost/filesystem.hpp> #include <boost/filesystem.hpp>
#include <gtkmm.h> #include <gtkmm.h>

6
src/project_build.cc → src/project_build.cpp

@ -1,6 +1,6 @@
#include "project_build.h" #include "project_build.hpp"
#include "config.h" #include "config.hpp"
#include "filesystem.h" #include "filesystem.hpp"
#include <boost/algorithm/string.hpp> #include <boost/algorithm/string.hpp>
std::unique_ptr<Project::Build> Project::Build::create(const boost::filesystem::path &path) { std::unique_ptr<Project::Build> Project::Build::create(const boost::filesystem::path &path) {

4
src/project_build.h → src/project_build.hpp

@ -1,6 +1,6 @@
#pragma once #pragma once
#include "cmake.h" #include "cmake.hpp"
#include "meson.h" #include "meson.hpp"
#include <boost/filesystem.hpp> #include <boost/filesystem.hpp>
namespace Project { namespace Project {

2
src/selection_dialog.cc → src/selection_dialog.cpp

@ -1,4 +1,4 @@
#include "selection_dialog.h" #include "selection_dialog.hpp"
#include <algorithm> #include <algorithm>
SelectionDialogBase::ListViewText::ListViewText(bool use_markup) : Gtk::TreeView(), use_markup(use_markup) { SelectionDialogBase::ListViewText::ListViewText(bool use_markup) : Gtk::TreeView(), use_markup(use_markup) {

2
src/selection_dialog.h → src/selection_dialog.hpp

@ -1,6 +1,6 @@
#pragma once #pragma once
#include "gtkmm.h"
#include <functional> #include <functional>
#include <gtkmm.h>
#include <unordered_map> #include <unordered_map>
class SelectionDialogBase { class SelectionDialogBase {

8
src/snippets.cc → src/snippets.cpp

@ -1,7 +1,7 @@
#include "snippets.h" #include "snippets.hpp"
#include "config.h" #include "config.hpp"
#include "filesystem.h" #include "filesystem.hpp"
#include "terminal.h" #include "terminal.hpp"
#include <boost/property_tree/json_parser.hpp> #include <boost/property_tree/json_parser.hpp>
void Snippets::load() { void Snippets::load() {

0
src/snippets.h → src/snippets.hpp

22
src/source.cc → src/source.cpp

@ -1,14 +1,14 @@
#include "source.h" #include "source.hpp"
#include "config.h" #include "config.hpp"
#include "ctags.h" #include "ctags.hpp"
#include "directories.h" #include "directories.hpp"
#include "filesystem.h" #include "filesystem.hpp"
#include "git.h" #include "git.hpp"
#include "info.h" #include "info.hpp"
#include "menu.h" #include "menu.hpp"
#include "selection_dialog.h" #include "selection_dialog.hpp"
#include "terminal.h" #include "terminal.hpp"
#include "utility.h" #include "utility.hpp"
#include <algorithm> #include <algorithm>
#include <boost/property_tree/json_parser.hpp> #include <boost/property_tree/json_parser.hpp>
#include <boost/spirit/home/qi/char.hpp> #include <boost/spirit/home/qi/char.hpp>

6
src/source.h → src/source.hpp

@ -1,7 +1,7 @@
#pragma once #pragma once
#include "source_diff.h" #include "source_diff.hpp"
#include "source_spellcheck.h" #include "source_spellcheck.hpp"
#include "tooltips.h" #include "tooltips.hpp"
#include <boost/filesystem.hpp> #include <boost/filesystem.hpp>
#include <boost/property_tree/xml_parser.hpp> #include <boost/property_tree/xml_parser.hpp>
#include <set> #include <set>

16
src/source_base.cc → src/source_base.cpp

@ -1,11 +1,11 @@
#include "source_base.h" #include "source_base.hpp"
#include "config.h" #include "config.hpp"
#include "filesystem.h" #include "filesystem.hpp"
#include "git.h" #include "git.hpp"
#include "info.h" #include "info.hpp"
#include "selection_dialog.h" #include "selection_dialog.hpp"
#include "terminal.h" #include "terminal.hpp"
#include "utility.h" #include "utility.hpp"
#include <fstream> #include <fstream>
#include <gtksourceview/gtksource.h> #include <gtksourceview/gtksource.h>
#include <regex> #include <regex>

4
src/source_base.h → src/source_base.hpp

@ -1,7 +1,7 @@
#pragma once #pragma once
#include "mutex.h" #include "mutex.hpp"
#include "snippets.h" #include "snippets.hpp"
#include <boost/filesystem.hpp> #include <boost/filesystem.hpp>
#include <gtksourceviewmm.h> #include <gtksourceviewmm.h>
#include <list> #include <list>

26
src/source_clang.cc → src/source_clang.cpp

@ -1,18 +1,18 @@
#include "source_clang.h" #include "source_clang.hpp"
#include "config.h" #include "config.hpp"
#include "project_build.h" #include "project_build.hpp"
#include "terminal.h" #include "terminal.hpp"
#ifdef JUCI_ENABLE_DEBUG #ifdef JUCI_ENABLE_DEBUG
#include "debug_lldb.h" #include "debug_lldb.hpp"
#endif #endif
#include "compile_commands.h" #include "compile_commands.hpp"
#include "ctags.h" #include "ctags.hpp"
#include "dialogs.h" #include "dialogs.hpp"
#include "documentation.h" #include "documentation.hpp"
#include "filesystem.h" #include "filesystem.hpp"
#include "info.h" #include "info.hpp"
#include "selection_dialog.h" #include "selection_dialog.hpp"
#include "usages_clang.h" #include "usages_clang.hpp"
const std::regex include_regex(R"(^[ \t]*#[ \t]*include[ \t]*[<"]([^<>"]+)[>"].*$)"); const std::regex include_regex(R"(^[ \t]*#[ \t]*include[ \t]*[<"]([^<>"]+)[>"].*$)");

10
src/source_clang.h → src/source_clang.hpp

@ -1,10 +1,10 @@
#pragma once #pragma once
#include "autocomplete.h" #include "autocomplete.hpp"
#include "clangmm.h" #include "clangmm.h"
#include "dispatcher.h" #include "dispatcher.hpp"
#include "mutex.h" #include "mutex.hpp"
#include "source.h" #include "source.hpp"
#include "terminal.h" #include "terminal.hpp"
#include <atomic> #include <atomic>
#include <map> #include <map>
#include <set> #include <set>

10
src/source_diff.cc → src/source_diff.cpp

@ -1,8 +1,8 @@
#include "source_diff.h" #include "source_diff.hpp"
#include "config.h" #include "config.hpp"
#include "filesystem.h" #include "filesystem.hpp"
#include "info.h" #include "info.hpp"
#include "terminal.h" #include "terminal.hpp"
#include <boost/version.hpp> #include <boost/version.hpp>
Source::DiffView::Renderer::Renderer() : Gsv::GutterRenderer() { Source::DiffView::Renderer::Renderer() : Gsv::GutterRenderer() {

8
src/source_diff.h → src/source_diff.hpp

@ -1,8 +1,8 @@
#pragma once #pragma once
#include "dispatcher.h" #include "dispatcher.hpp"
#include "git.h" #include "git.hpp"
#include "mutex.h" #include "mutex.hpp"
#include "source_base.h" #include "source_base.hpp"
#include <atomic> #include <atomic>
#include <boost/filesystem.hpp> #include <boost/filesystem.hpp>
#include <map> #include <map>

12
src/source_generic.cc → src/source_generic.cpp

@ -1,9 +1,9 @@
#include "source_generic.h" #include "source_generic.hpp"
#include "filesystem.h" #include "filesystem.hpp"
#include "info.h" #include "info.hpp"
#include "selection_dialog.h" #include "selection_dialog.hpp"
#include "snippets.h" #include "snippets.hpp"
#include "terminal.h" #include "terminal.hpp"
#include <algorithm> #include <algorithm>
Source::GenericView::GenericView(const boost::filesystem::path &file_path, const Glib::RefPtr<Gsv::Language> &language) : BaseView(file_path, language), View(file_path, language, true), autocomplete(this, interactive_completion, last_keyval, false) { Source::GenericView::GenericView(const boost::filesystem::path &file_path, const Glib::RefPtr<Gsv::Language> &language) : BaseView(file_path, language), View(file_path, language, true), autocomplete(this, interactive_completion, last_keyval, false) {

6
src/source_generic.h → src/source_generic.hpp

@ -1,8 +1,8 @@
#pragma once #pragma once
#include "autocomplete.h" #include "autocomplete.hpp"
#include "mutex.h" #include "mutex.hpp"
#include "source.h" #include "source.hpp"
#include <atomic> #include <atomic>
namespace Source { namespace Source {

20
src/source_language_protocol.cc → src/source_language_protocol.cpp

@ -1,15 +1,15 @@
#include "source_language_protocol.h" #include "source_language_protocol.hpp"
#include "filesystem.h" #include "filesystem.hpp"
#include "info.h" #include "info.hpp"
#include "notebook.h" #include "notebook.hpp"
#include "project.h" #include "project.hpp"
#include "selection_dialog.h" #include "selection_dialog.hpp"
#include "terminal.h" #include "terminal.hpp"
#ifdef JUCI_ENABLE_DEBUG #ifdef JUCI_ENABLE_DEBUG
#include "debug_lldb.h" #include "debug_lldb.hpp"
#endif #endif
#include "config.h" #include "config.hpp"
#include "menu.h" #include "menu.hpp"
#include <future> #include <future>
#include <limits> #include <limits>
#include <regex> #include <regex>

6
src/source_language_protocol.h → src/source_language_protocol.hpp

@ -1,8 +1,8 @@
#pragma once #pragma once
#include "autocomplete.h" #include "autocomplete.hpp"
#include "mutex.h" #include "mutex.hpp"
#include "process.hpp" #include "process.hpp"
#include "source.h" #include "source.hpp"
#include <atomic> #include <atomic>
#include <boost/property_tree/json_parser.hpp> #include <boost/property_tree/json_parser.hpp>
#include <list> #include <list>

8
src/source_spellcheck.cc → src/source_spellcheck.cpp

@ -1,7 +1,7 @@
#include "source_spellcheck.h" #include "source_spellcheck.hpp"
#include "config.h" #include "config.hpp"
#include "info.h" #include "info.hpp"
#include "selection_dialog.h" #include "selection_dialog.hpp"
#include <iostream> #include <iostream>
AspellConfig *Source::SpellCheckView::spellcheck_config = nullptr; AspellConfig *Source::SpellCheckView::spellcheck_config = nullptr;

2
src/source_spellcheck.h → src/source_spellcheck.hpp

@ -1,5 +1,5 @@
#pragma once #pragma once
#include "source_base.h" #include "source_base.hpp"
#include <aspell.h> #include <aspell.h>
namespace Source { namespace Source {

12
src/terminal.cc → src/terminal.cpp

@ -1,9 +1,9 @@
#include "terminal.h" #include "terminal.hpp"
#include "config.h" #include "config.hpp"
#include "filesystem.h" #include "filesystem.hpp"
#include "info.h" #include "info.hpp"
#include "notebook.h" #include "notebook.hpp"
#include "project.h" #include "project.hpp"
#include <iostream> #include <iostream>
#include <regex> #include <regex>
#include <thread> #include <thread>

8
src/terminal.h → src/terminal.hpp

@ -1,11 +1,11 @@
#pragma once #pragma once
#include "dispatcher.h" #include "dispatcher.hpp"
#include "gtkmm.h" #include "mutex.hpp"
#include "mutex.h"
#include "process.hpp" #include "process.hpp"
#include "source_base.h" #include "source_base.hpp"
#include <boost/filesystem.hpp> #include <boost/filesystem.hpp>
#include <functional> #include <functional>
#include <gtkmm.h>
#include <iostream> #include <iostream>
#include <tuple> #include <tuple>

12
src/tooltips.cc → src/tooltips.cpp

@ -1,9 +1,9 @@
#include "tooltips.h" #include "tooltips.hpp"
#include "config.h" #include "config.hpp"
#include "filesystem.h" #include "filesystem.hpp"
#include "info.h" #include "info.hpp"
#include "notebook.h" #include "notebook.hpp"
#include "selection_dialog.h" #include "selection_dialog.hpp"
#include <algorithm> #include <algorithm>
#include <regex> #include <regex>

2
src/tooltips.h → src/tooltips.hpp

@ -1,6 +1,6 @@
#pragma once #pragma once
#include "gtkmm.h"
#include <functional> #include <functional>
#include <gtkmm.h>
#include <list> #include <list>
#include <set> #include <set>
#include <string> #include <string>

12
src/usages_clang.cc → src/usages_clang.cpp

@ -1,9 +1,9 @@
#include "usages_clang.h" #include "usages_clang.hpp"
#include "compile_commands.h" #include "compile_commands.hpp"
#include "config.h" #include "config.hpp"
#include "dialogs.h" #include "dialogs.hpp"
#include "filesystem.h" #include "filesystem.hpp"
#include "utility.h" #include "utility.hpp"
#include <chrono> #include <chrono>
#include <fstream> #include <fstream>
#include <regex> #include <regex>

2
src/usages_clang.h → src/usages_clang.hpp

@ -1,6 +1,6 @@
#pragma once #pragma once
#include "clangmm.h" #include "clangmm.h"
#include "mutex.h" #include "mutex.hpp"
#include <atomic> #include <atomic>
#include <boost/archive/text_iarchive.hpp> #include <boost/archive/text_iarchive.hpp>
#include <boost/archive/text_oarchive.hpp> #include <boost/archive/text_oarchive.hpp>

2
src/utility.cc → src/utility.cpp

@ -1,4 +1,4 @@
#include "utility.h" #include "utility.hpp"
ScopeGuard::~ScopeGuard() { ScopeGuard::~ScopeGuard() {
if(on_exit) if(on_exit)

0
src/utility.h → src/utility.hpp

30
src/window.cc → src/window.cpp

@ -1,20 +1,20 @@
#include "window.h" #include "window.hpp"
#include "config.h" #include "config.hpp"
#ifdef JUCI_ENABLE_DEBUG #ifdef JUCI_ENABLE_DEBUG
#include "debug_lldb.h" #include "debug_lldb.hpp"
#endif #endif
#include "compile_commands.h" #include "compile_commands.hpp"
#include "dialogs.h" #include "dialogs.hpp"
#include "directories.h" #include "directories.hpp"
#include "entrybox.h" #include "entrybox.hpp"
#include "filesystem.h" #include "filesystem.hpp"
#include "grep.h" #include "grep.hpp"
#include "info.h" #include "info.hpp"
#include "menu.h" #include "menu.hpp"
#include "notebook.h" #include "notebook.hpp"
#include "project.h" #include "project.hpp"
#include "selection_dialog.h" #include "selection_dialog.hpp"
#include "terminal.h" #include "terminal.hpp"
Window::Window() { Window::Window() {
Gsv::init(); Gsv::init();

2
src/window.h → src/window.hpp

@ -1,5 +1,5 @@
#pragma once #pragma once
#include "source_base.h" #include "source_base.hpp"
#include <atomic> #include <atomic>
#include <boost/filesystem.hpp> #include <boost/filesystem.hpp>
#include <gtkmm.h> #include <gtkmm.h>

0
src/window_macos.h → src/window_macos.hpp

44
tests/CMakeLists.txt

@ -12,75 +12,75 @@ include_directories(
) )
add_library(test_stubs OBJECT add_library(test_stubs OBJECT
stubs/config.cc stubs/config.cpp
stubs/dialogs.cc stubs/dialogs.cpp
stubs/directories.cc stubs/directories.cpp
stubs/info.cc stubs/info.cpp
stubs/notebook.cc stubs/notebook.cpp
stubs/project.cc stubs/project.cpp
stubs/selection_dialog.cc stubs/selection_dialog.cpp
) )
add_executable(process_test process_test.cc $<TARGET_OBJECTS:test_stubs>) add_executable(process_test process_test.cpp $<TARGET_OBJECTS:test_stubs>)
target_link_libraries(process_test juci_shared) target_link_libraries(process_test juci_shared)
add_test(process_test process_test) add_test(process_test process_test)
add_executable(compile_commands_test compile_commands_test.cc $<TARGET_OBJECTS:test_stubs>) add_executable(compile_commands_test compile_commands_test.cpp $<TARGET_OBJECTS:test_stubs>)
target_link_libraries(compile_commands_test juci_shared) target_link_libraries(compile_commands_test juci_shared)
add_test(compile_commands_test compile_commands_test) add_test(compile_commands_test compile_commands_test)
add_executable(filesystem_test filesystem_test.cc $<TARGET_OBJECTS:test_stubs>) add_executable(filesystem_test filesystem_test.cpp $<TARGET_OBJECTS:test_stubs>)
target_link_libraries(filesystem_test juci_shared) target_link_libraries(filesystem_test juci_shared)
add_test(filesystem_test filesystem_test) add_test(filesystem_test filesystem_test)
add_executable(cmake_build_test cmake_build_test.cc $<TARGET_OBJECTS:test_stubs>) add_executable(cmake_build_test cmake_build_test.cpp $<TARGET_OBJECTS:test_stubs>)
target_link_libraries(cmake_build_test juci_shared) target_link_libraries(cmake_build_test juci_shared)
add_test(cmake_build_test cmake_build_test) add_test(cmake_build_test cmake_build_test)
add_executable(meson_build_test meson_build_test.cc $<TARGET_OBJECTS:test_stubs>) add_executable(meson_build_test meson_build_test.cpp $<TARGET_OBJECTS:test_stubs>)
target_link_libraries(meson_build_test juci_shared) target_link_libraries(meson_build_test juci_shared)
add_test(meson_build_test meson_build_test) add_test(meson_build_test meson_build_test)
add_executable(source_test source_test.cc $<TARGET_OBJECTS:test_stubs>) add_executable(source_test source_test.cpp $<TARGET_OBJECTS:test_stubs>)
target_link_libraries(source_test juci_shared) target_link_libraries(source_test juci_shared)
add_test(source_test source_test) add_test(source_test source_test)
add_executable(source_clang_test source_clang_test.cc $<TARGET_OBJECTS:test_stubs>) add_executable(source_clang_test source_clang_test.cpp $<TARGET_OBJECTS:test_stubs>)
target_link_libraries(source_clang_test juci_shared) target_link_libraries(source_clang_test juci_shared)
add_test(source_clang_test source_clang_test) add_test(source_clang_test source_clang_test)
add_executable(source_generic_test source_generic_test.cc $<TARGET_OBJECTS:test_stubs>) add_executable(source_generic_test source_generic_test.cpp $<TARGET_OBJECTS:test_stubs>)
target_link_libraries(source_generic_test juci_shared) target_link_libraries(source_generic_test juci_shared)
add_test(source_generic_test source_generic_test) add_test(source_generic_test source_generic_test)
add_executable(source_key_test source_key_test.cc $<TARGET_OBJECTS:test_stubs>) add_executable(source_key_test source_key_test.cpp $<TARGET_OBJECTS:test_stubs>)
target_link_libraries(source_key_test juci_shared) target_link_libraries(source_key_test juci_shared)
add_test(source_key_test source_key_test) add_test(source_key_test source_key_test)
add_executable(terminal_test terminal_test.cc $<TARGET_OBJECTS:test_stubs>) add_executable(terminal_test terminal_test.cpp $<TARGET_OBJECTS:test_stubs>)
target_link_libraries(terminal_test juci_shared) target_link_libraries(terminal_test juci_shared)
add_test(terminal_test terminal_test) add_test(terminal_test terminal_test)
add_executable(usages_clang_test usages_clang_test.cc $<TARGET_OBJECTS:test_stubs>) add_executable(usages_clang_test usages_clang_test.cpp $<TARGET_OBJECTS:test_stubs>)
target_link_libraries(usages_clang_test juci_shared) target_link_libraries(usages_clang_test juci_shared)
add_test(usages_clang_test usages_clang_test) add_test(usages_clang_test usages_clang_test)
if(LIBLLDB_FOUND) if(LIBLLDB_FOUND)
add_executable(lldb_test lldb_test.cc $<TARGET_OBJECTS:test_stubs>) add_executable(lldb_test lldb_test.cpp $<TARGET_OBJECTS:test_stubs>)
target_link_libraries(lldb_test juci_shared) target_link_libraries(lldb_test juci_shared)
add_test(lldb_test lldb_test) add_test(lldb_test lldb_test)
add_subdirectory("lldb_test_files") add_subdirectory("lldb_test_files")
endif() endif()
add_executable(git_test git_test.cc $<TARGET_OBJECTS:test_stubs>) add_executable(git_test git_test.cpp $<TARGET_OBJECTS:test_stubs>)
target_link_libraries(git_test juci_shared) target_link_libraries(git_test juci_shared)
add_test(git_test git_test) add_test(git_test git_test)
add_executable(ctags_grep_test ctags_grep_test.cc $<TARGET_OBJECTS:test_stubs>) add_executable(ctags_grep_test ctags_grep_test.cpp $<TARGET_OBJECTS:test_stubs>)
target_link_libraries(ctags_grep_test juci_shared) target_link_libraries(ctags_grep_test juci_shared)
add_test(ctags_grep_test ctags_grep_test) add_test(ctags_grep_test ctags_grep_test)
add_executable(tooltips_test tooltips_test.cc $<TARGET_OBJECTS:test_stubs>) add_executable(tooltips_test tooltips_test.cpp $<TARGET_OBJECTS:test_stubs>)
target_link_libraries(tooltips_test juci_shared) target_link_libraries(tooltips_test juci_shared)
add_test(tooltips_test tooltips_test) add_test(tooltips_test tooltips_test)

18
tests/cmake_build_test.cc → tests/cmake_build_test.cpp

@ -1,7 +1,7 @@
#include "cmake.h" #include "cmake.hpp"
#include "config.h" #include "config.hpp"
#include "process.hpp" #include "process.hpp"
#include "project_build.h" #include "project_build.hpp"
#include <boost/filesystem.hpp> #include <boost/filesystem.hpp>
#include <glib.h> #include <glib.h>
@ -19,14 +19,14 @@ int main() {
g_assert(process.get_exit_status() == 0); g_assert(process.get_exit_status() == 0);
g_assert(cmake.get_executable(project_path / "build", project_path) == ""); g_assert(cmake.get_executable(project_path / "build", project_path) == "");
g_assert(cmake.get_executable(project_path / "build" / "non_existing_file.cc", project_path) == ""); g_assert(cmake.get_executable(project_path / "build" / "non_existing_file.cpp", project_path) == "");
} }
{ {
CMake cmake(project_path / "src"); CMake cmake(project_path / "src");
g_assert(cmake.get_executable(project_path / "build", project_path / "src") == project_path / "build" / "src" / "juci"); g_assert(cmake.get_executable(project_path / "build", project_path / "src") == project_path / "build" / "src" / "juci");
g_assert(cmake.get_executable(project_path / "build", project_path / "src" / "cmake.cc") == project_path / "build" / "src" / "juci"); g_assert(cmake.get_executable(project_path / "build", project_path / "src" / "cmake.cpp") == project_path / "build" / "src" / "juci");
g_assert(cmake.get_executable(project_path / "build", project_path / "src" / "juci.cc") == project_path / "build" / "src" / "juci"); g_assert(cmake.get_executable(project_path / "build", project_path / "src" / "juci.cpp") == project_path / "build" / "src" / "juci");
g_assert(cmake.get_executable(project_path / "build", project_path / "src" / "non_existing_file.cc") == project_path / "build" / "src" / "juci"); g_assert(cmake.get_executable(project_path / "build", project_path / "src" / "non_existing_file.cpp") == project_path / "build" / "src" / "juci");
} }
{ {
CMake cmake(tests_path); CMake cmake(tests_path);
@ -37,8 +37,8 @@ int main() {
g_assert(functions_parameters.at(0).second.at(0) == "juci"); g_assert(functions_parameters.at(0).second.at(0) == "juci");
g_assert(cmake.get_executable(project_path / "build", tests_path).parent_path() == project_path / "build" / "tests"); g_assert(cmake.get_executable(project_path / "build", tests_path).parent_path() == project_path / "build" / "tests");
g_assert(cmake.get_executable(project_path / "build", tests_path / "cmake_build_test.cc") == project_path / "build" / "tests" / "cmake_build_test"); g_assert(cmake.get_executable(project_path / "build", tests_path / "cmake_build_test.cpp") == project_path / "build" / "tests" / "cmake_build_test");
g_assert(cmake.get_executable(project_path / "build", tests_path / "non_existing_file.cc").parent_path() == project_path / "build" / "tests"); g_assert(cmake.get_executable(project_path / "build", tests_path / "non_existing_file.cpp").parent_path() == project_path / "build" / "tests");
} }
auto build = Project::Build::create(tests_path); auto build = Project::Build::create(tests_path);

2
tests/compile_commands_test.cc → tests/compile_commands_test.cpp

@ -1,4 +1,4 @@
#include "compile_commands.h" #include "compile_commands.hpp"
#include <glib.h> #include <glib.h>
#include <gtkmm.h> #include <gtkmm.h>
#include <gtksourceviewmm.h> #include <gtksourceviewmm.h>

40
tests/ctags_grep_test.cc → tests/ctags_grep_test.cpp

@ -1,6 +1,6 @@
#include "config.h" #include "config.hpp"
#include "ctags.h" #include "ctags.hpp"
#include "grep.h" #include "grep.hpp"
#include <glib.h> #include <glib.h>
#include <gtkmm.h> #include <gtkmm.h>
#include <gtksourceviewmm.h> #include <gtksourceviewmm.h>
@ -38,7 +38,7 @@ int main() {
{ {
auto location = ctags.get_location(line, false); auto location = ctags.get_location(line, false);
g_assert(location.source == "void ctags_grep_test_function() {"); g_assert(location.source == "void ctags_grep_test_function() {");
g_assert(ctags.project_path / location.file_path == tests_path / "ctags_grep_test.cc"); g_assert(ctags.project_path / location.file_path == tests_path / "ctags_grep_test.cpp");
g_assert_cmpint(location.line, ==, 7); g_assert_cmpint(location.line, ==, 7);
g_assert_cmpint(location.index, ==, 5); g_assert_cmpint(location.index, ==, 5);
g_assert(location.symbol == "ctags_grep_test_function"); g_assert(location.symbol == "ctags_grep_test_function");
@ -48,7 +48,7 @@ int main() {
{ {
auto location = ctags.get_location(line, true); auto location = ctags.get_location(line, true);
g_assert(location.source == "void <b>ctags_grep_test_function</b>() {"); g_assert(location.source == "void <b>ctags_grep_test_function</b>() {");
g_assert(ctags.project_path / location.file_path == tests_path / "ctags_grep_test.cc"); g_assert(ctags.project_path / location.file_path == tests_path / "ctags_grep_test.cpp");
g_assert_cmpint(location.line, ==, 7); g_assert_cmpint(location.line, ==, 7);
g_assert_cmpint(location.index, ==, 5); g_assert_cmpint(location.index, ==, 5);
g_assert(location.symbol == "ctags_grep_test_function"); g_assert(location.symbol == "ctags_grep_test_function");
@ -71,7 +71,7 @@ int main() {
{ {
auto location = ctags.get_location(line, false); auto location = ctags.get_location(line, false);
g_assert(location.source == "void ctags_grep_test_function() {"); g_assert(location.source == "void ctags_grep_test_function() {");
g_assert(ctags.project_path / location.file_path == tests_path / "ctags_grep_test.cc"); g_assert(ctags.project_path / location.file_path == tests_path / "ctags_grep_test.cpp");
g_assert_cmpint(location.line, ==, 7); g_assert_cmpint(location.line, ==, 7);
g_assert_cmpint(location.index, ==, 5); g_assert_cmpint(location.index, ==, 5);
g_assert(location.symbol == "ctags_grep_test_function"); g_assert(location.symbol == "ctags_grep_test_function");
@ -81,7 +81,7 @@ int main() {
{ {
auto location = ctags.get_location(line, true); auto location = ctags.get_location(line, true);
g_assert(location.source == "void <b>ctags_grep_test_function</b>() {"); g_assert(location.source == "void <b>ctags_grep_test_function</b>() {");
g_assert(ctags.project_path / location.file_path == tests_path / "ctags_grep_test.cc"); g_assert(ctags.project_path / location.file_path == tests_path / "ctags_grep_test.cpp");
g_assert_cmpint(location.line, ==, 7); g_assert_cmpint(location.line, ==, 7);
g_assert_cmpint(location.index, ==, 5); g_assert_cmpint(location.index, ==, 5);
g_assert(location.symbol == "ctags_grep_test_function"); g_assert(location.symbol == "ctags_grep_test_function");
@ -104,7 +104,7 @@ int main() {
{ {
auto location = ctags.get_location(line, false); auto location = ctags.get_location(line, false);
g_assert(location.source == "void ctags_grep_test_function2() {"); g_assert(location.source == "void ctags_grep_test_function2() {");
g_assert(ctags.project_path / location.file_path == tests_path / "ctags_grep_test.cc"); g_assert(ctags.project_path / location.file_path == tests_path / "ctags_grep_test.cpp");
g_assert_cmpint(location.line, ==, 11); g_assert_cmpint(location.line, ==, 11);
g_assert_cmpint(location.index, ==, 7); g_assert_cmpint(location.index, ==, 7);
g_assert(location.symbol == "ctags_grep_test_function2"); g_assert(location.symbol == "ctags_grep_test_function2");
@ -128,43 +128,43 @@ int main() {
if(line.find("ctags_grep_test_function") != std::string::npos) { if(line.find("ctags_grep_test_function") != std::string::npos) {
{ {
auto location = grep.get_location(line, true, true); auto location = grep.get_location(line, true, true);
g_assert(location.markup == "tests/ctags_grep_test.cc:8:void <b>ctags_grep_test_function</b>() {"); g_assert(location.markup == "tests/ctags_grep_test.cpp:8:void <b>ctags_grep_test_function</b>() {");
g_assert(grep.project_path / location.file_path == tests_path / "ctags_grep_test.cc"); g_assert(grep.project_path / location.file_path == tests_path / "ctags_grep_test.cpp");
g_assert_cmpint(location.line, ==, 7); g_assert_cmpint(location.line, ==, 7);
g_assert_cmpint(location.offset, ==, 5); g_assert_cmpint(location.offset, ==, 5);
{ {
auto location2 = grep.get_location(location.markup, false, true); auto location2 = grep.get_location(location.markup, false, true);
g_assert(location2.markup == "tests/ctags_grep_test.cc:8:void <b>ctags_grep_test_function</b>() {"); g_assert(location2.markup == "tests/ctags_grep_test.cpp:8:void <b>ctags_grep_test_function</b>() {");
g_assert(grep.project_path / location2.file_path == tests_path / "ctags_grep_test.cc"); g_assert(grep.project_path / location2.file_path == tests_path / "ctags_grep_test.cpp");
g_assert_cmpint(location2.line, ==, 7); g_assert_cmpint(location2.line, ==, 7);
g_assert_cmpint(location2.offset, ==, 5); g_assert_cmpint(location2.offset, ==, 5);
} }
} }
{ {
auto location = grep.get_location(line, true, false); auto location = grep.get_location(line, true, false);
g_assert(location.markup == "tests/ctags_grep_test.cc:8:void <b>ctags_grep_test_function</b>() {"); g_assert(location.markup == "tests/ctags_grep_test.cpp:8:void <b>ctags_grep_test_function</b>() {");
g_assert(grep.project_path / location.file_path == tests_path / "ctags_grep_test.cc"); g_assert(grep.project_path / location.file_path == tests_path / "ctags_grep_test.cpp");
g_assert_cmpint(location.line, ==, 7); g_assert_cmpint(location.line, ==, 7);
g_assert_cmpint(location.offset, ==, 0); g_assert_cmpint(location.offset, ==, 0);
{ {
auto location2 = grep.get_location(location.markup, false, false); auto location2 = grep.get_location(location.markup, false, false);
g_assert(location2.markup == "tests/ctags_grep_test.cc:8:void <b>ctags_grep_test_function</b>() {"); g_assert(location2.markup == "tests/ctags_grep_test.cpp:8:void <b>ctags_grep_test_function</b>() {");
g_assert(grep.project_path / location2.file_path == tests_path / "ctags_grep_test.cc"); g_assert(grep.project_path / location2.file_path == tests_path / "ctags_grep_test.cpp");
g_assert_cmpint(location2.line, ==, 7); g_assert_cmpint(location2.line, ==, 7);
g_assert_cmpint(location2.offset, ==, 0); g_assert_cmpint(location2.offset, ==, 0);
} }
} }
{ {
auto location = grep.get_location(line, true, true, (boost::filesystem::path("tests") / "ctags_grep_test.cc").string()); auto location = grep.get_location(line, true, true, (boost::filesystem::path("tests") / "ctags_grep_test.cpp").string());
g_assert(location.markup == "tests/ctags_grep_test.cc:8:void <b>ctags_grep_test_function</b>() {"); g_assert(location.markup == "tests/ctags_grep_test.cpp:8:void <b>ctags_grep_test_function</b>() {");
g_assert(grep.project_path / location.file_path == tests_path / "ctags_grep_test.cc"); g_assert(grep.project_path / location.file_path == tests_path / "ctags_grep_test.cpp");
g_assert(location); g_assert(location);
g_assert_cmpint(location.line, ==, 7); g_assert_cmpint(location.line, ==, 7);
g_assert_cmpint(location.offset, ==, 5); g_assert_cmpint(location.offset, ==, 5);
} }
{ {
auto location = grep.get_location(line, true, true, "CMakeLists.txt"); auto location = grep.get_location(line, true, true, "CMakeLists.txt");
g_assert(location.markup == "tests/ctags_grep_test.cc:8:void <b>ctags_grep_test_function</b>() {"); g_assert(location.markup == "tests/ctags_grep_test.cpp:8:void <b>ctags_grep_test_function</b>() {");
g_assert(location.file_path.empty()); g_assert(location.file_path.empty());
g_assert(!location); g_assert(!location);
} }

2
tests/filesystem_test.cc → tests/filesystem_test.cpp

@ -1,4 +1,4 @@
#include "filesystem.h" #include "filesystem.hpp"
#include <glib.h> #include <glib.h>
int main() { int main() {

6
tests/git_test.cc → tests/git_test.cpp

@ -1,4 +1,4 @@
#include "git.h" #include "git.hpp"
#include <boost/filesystem.hpp> #include <boost/filesystem.hpp>
#include <glib.h> #include <glib.h>
#include <gtkmm.h> #include <gtkmm.h>
@ -18,8 +18,8 @@ int main() {
auto status = repository->get_status(); auto status = repository->get_status();
auto diff = repository->get_diff((boost::filesystem::path("tests") / "git_test.cc")); auto diff = repository->get_diff((boost::filesystem::path("tests") / "git_test.cpp"));
auto lines = diff.get_lines("#include added\n#include \"git.h\"\n#include modified\n#include <glib.h>\n"); auto lines = diff.get_lines("#include added\n#include \"git.hpp\"\n#include modified\n#include <glib.h>\n");
g_assert_cmpuint(lines.added.size(), ==, 1); g_assert_cmpuint(lines.added.size(), ==, 1);
g_assert_cmpuint(lines.modified.size(), ==, 1); g_assert_cmpuint(lines.modified.size(), ==, 1);
g_assert_cmpuint(lines.removed.size(), ==, 1); g_assert_cmpuint(lines.removed.size(), ==, 1);

2
tests/lldb_test.cc → tests/lldb_test.cpp

@ -1,4 +1,4 @@
#include "debug_lldb.h" #include "debug_lldb.hpp"
#include <atomic> #include <atomic>
#include <boost/filesystem.hpp> #include <boost/filesystem.hpp>
#include <glib.h> #include <glib.h>

4
tests/meson_build_test.cc → tests/meson_build_test.cpp

@ -1,5 +1,5 @@
#include "meson.h" #include "meson.hpp"
#include "project.h" #include "project.hpp"
#include <glib.h> #include <glib.h>
int main() { int main() {

0
tests/process_test.cc → tests/process_test.cpp

6
tests/source_clang_test.cc → tests/source_clang_test.cpp

@ -1,6 +1,6 @@
#include "config.h" #include "config.hpp"
#include "filesystem.h" #include "filesystem.hpp"
#include "source_clang.h" #include "source_clang.hpp"
#include <glib.h> #include <glib.h>
std::string main_error = R"(int main() { std::string main_error = R"(int main() {

2
tests/source_generic_test.cc → tests/source_generic_test.cpp

@ -1,4 +1,4 @@
#include "source_generic.h" #include "source_generic.hpp"
#include <glib.h> #include <glib.h>
int main() { int main() {

4
tests/source_key_test.cc → tests/source_key_test.cpp

@ -1,5 +1,5 @@
#include "config.h" #include "config.hpp"
#include "source.h" #include "source.hpp"
#include <glib.h> #include <glib.h>
//Requires display server to work //Requires display server to work

4
tests/source_test.cc → tests/source_test.cpp

@ -1,5 +1,5 @@
#include "filesystem.h" #include "filesystem.hpp"
#include "source.h" #include "source.hpp"
#include <glib.h> #include <glib.h>
std::string hello_world = R"(#include <iostream> std::string hello_world = R"(#include <iostream>

3
tests/stubs/config.cc

@ -1,3 +0,0 @@
#include "config.h"
Config::Config() {}

3
tests/stubs/config.cpp

@ -0,0 +1,3 @@
#include "config.hpp"
Config::Config() {}

2
tests/stubs/dialogs.cc → tests/stubs/dialogs.cpp

@ -1,4 +1,4 @@
#include "dialogs.h" #include "dialogs.hpp"
Dialog::Message::Message(const std::string &text) : Gtk::Window(Gtk::WindowType::WINDOW_POPUP) {} Dialog::Message::Message(const std::string &text) : Gtk::Window(Gtk::WindowType::WINDOW_POPUP) {}

2
tests/stubs/directories.cc → tests/stubs/directories.cpp

@ -1,4 +1,4 @@
#include "directories.h" #include "directories.hpp"
Directories::Directories() : ListViewText(1) {} Directories::Directories() : ListViewText(1) {}

2
tests/stubs/info.cc → tests/stubs/info.cpp

@ -1,4 +1,4 @@
#include "info.h" #include "info.hpp"
Info::Info() {} Info::Info() {}

2
tests/stubs/notebook.cc → tests/stubs/notebook.cpp

@ -1,4 +1,4 @@
#include "notebook.h" #include "notebook.hpp"
Notebook::Notebook() {} Notebook::Notebook() {}

2
tests/stubs/project.cc → tests/stubs/project.cpp

@ -1,3 +1,3 @@
#include "project.h" #include "project.hpp"
std::shared_ptr<Project::Base> Project::current; std::shared_ptr<Project::Base> Project::current;

2
tests/stubs/selection_dialog.cc → tests/stubs/selection_dialog.cpp

@ -1,4 +1,4 @@
#include "selection_dialog.h" #include "selection_dialog.hpp"
SelectionDialogBase::ListViewText::ListViewText(bool use_markup) {} SelectionDialogBase::ListViewText::ListViewText(bool use_markup) {}

2
tests/terminal_test.cc → tests/terminal_test.cpp

@ -1,4 +1,4 @@
#include "terminal.h" #include "terminal.hpp"
#include <glib.h> #include <glib.h>
#include <gtksourceviewmm.h> #include <gtksourceviewmm.h>

2
tests/tooltips_test.cc → tests/tooltips_test.cpp

@ -1,4 +1,4 @@
#include "tooltips.h" #include "tooltips.hpp"
#include <glib.h> #include <glib.h>
#include <gtkmm.h> #include <gtkmm.h>

8
tests/usages_clang_test.cc → tests/usages_clang_test.cpp

@ -1,8 +1,8 @@
#include "clangmm.h" #include "clangmm.h"
#include "compile_commands.h" #include "compile_commands.hpp"
#include "meson.h" #include "meson.hpp"
#include "project.h" #include "project.hpp"
#include "usages_clang.h" #include "usages_clang.hpp"
#include <cassert> #include <cassert>
#include <fstream> #include <fstream>
#include <gtksourceviewmm.h> #include <gtksourceviewmm.h>
Loading…
Cancel
Save