diff --git a/6-InRealEnvironment/6-Tools.ipynb b/6-InRealEnvironment/6-Tools.ipynb index e5e6c3ca62c3be2226882efa9b15ad6a8d8de391..fca71ccd7088fc29af7738d2510de7d93e7ad02a 100644 --- a/6-InRealEnvironment/6-Tools.ipynb +++ b/6-InRealEnvironment/6-Tools.ipynb @@ -14,7 +14,7 @@ }, "source": [ "<h1>Table of contents<span class=\"tocSkip\"></span></h1>\n", - "<div class=\"toc\"><ul class=\"toc-item\"><li><span><a href=\"#Introduction\" data-toc-modified-id=\"Introduction-1\">Introduction</a></span></li><li><span><a href=\"#Online-compilers\" data-toc-modified-id=\"Online-compilers-2\">Online compilers</a></span></li><li><span><a href=\"#Static-analyzer-tools\" data-toc-modified-id=\"Static-analyzer-tools-3\">Static analyzer tools</a></span></li><li><span><a href=\"#Valgrind\" data-toc-modified-id=\"Valgrind-4\">Valgrind</a></span></li><li><span><a href=\"#Sonarqube\" data-toc-modified-id=\"Sonarqube-5\">Sonarqube</a></span></li><li><span><a href=\"#Tests\" data-toc-modified-id=\"Tests-6\">Tests</a></span><ul class=\"toc-item\"><li><span><a href=\"#Boost-tests\" data-toc-modified-id=\"Boost-tests-6.1\">Boost tests</a></span></li><li><span><a href=\"#Catch2\" data-toc-modified-id=\"Catch2-6.2\">Catch2</a></span></li><li><span><a href=\"#Google-test\" data-toc-modified-id=\"Google-test-6.3\">Google test</a></span></li></ul></li><li><span><a href=\"#Build-system\" data-toc-modified-id=\"Build-system-7\">Build system</a></span></li><li><span><a href=\"#Debugguer\" data-toc-modified-id=\"Debugguer-8\">Debugguer</a></span></li><li><span><a href=\"#Profiler\" data-toc-modified-id=\"Profiler-9\">Profiler</a></span></li><li><span><a href=\"#Doxygen\" data-toc-modified-id=\"Doxygen-10\">Doxygen</a></span></li></ul></div>" + "<div class=\"toc\"><ul class=\"toc-item\"><li><span><a href=\"#Introduction\" data-toc-modified-id=\"Introduction-1\">Introduction</a></span></li><li><span><a href=\"#Online-compilers\" data-toc-modified-id=\"Online-compilers-2\">Online compilers</a></span></li><li><span><a href=\"#Static-analyzer-tools\" data-toc-modified-id=\"Static-analyzer-tools-3\">Static analyzer tools</a></span></li><li><span><a href=\"#Valgrind\" data-toc-modified-id=\"Valgrind-4\">Valgrind</a></span></li><li><span><a href=\"#Address-sanitizer\" data-toc-modified-id=\"Address-sanitizer-5\">Address sanitizer</a></span></li><li><span><a href=\"#Sonarqube\" data-toc-modified-id=\"Sonarqube-6\">Sonarqube</a></span></li><li><span><a href=\"#Tests\" data-toc-modified-id=\"Tests-7\">Tests</a></span><ul class=\"toc-item\"><li><span><a href=\"#Boost-tests\" data-toc-modified-id=\"Boost-tests-7.1\">Boost tests</a></span></li><li><span><a href=\"#Catch2\" data-toc-modified-id=\"Catch2-7.2\">Catch2</a></span></li><li><span><a href=\"#Google-test\" data-toc-modified-id=\"Google-test-7.3\">Google test</a></span></li></ul></li><li><span><a href=\"#Build-system\" data-toc-modified-id=\"Build-system-8\">Build system</a></span></li><li><span><a href=\"#Code-formatters\" data-toc-modified-id=\"Code-formatters-9\">Code formatters</a></span></li><li><span><a href=\"#Doxygen\" data-toc-modified-id=\"Doxygen-10\">Doxygen</a></span></li></ul></div>" ] }, { @@ -24,7 +24,7 @@ "## Introduction\n", "\n", "The purpose of this notebook is just to namedrop briefly some facilities related to C++ that might be useful.\n", - "It's far from exhaustive - I won't present debugguers as usually they are provided directly with your IDE (and if you're a Vim or Emacs user you probably already familiar with [gdb](https://www.gnu.org/software/gdb/)).\n", + "It's far from exhaustive - I won't present debuggers as usually they are provided directly with your IDE (and if you're a Vim or Emacs user you probably already familiar with [gdb](https://www.gnu.org/software/gdb/)).\n", "\n", "Some tools are redundant, but they are complementary: the more you may be able to use the better. The constraint is time: it is not straightforward to use some of those, and even for the user-friendly ones there is a non neglictible set-up time. But for projects that are gaining traction it becomes a no-brainer at some point to set-up those properly once and for all - usually part of [continuous integration](https://gitlab.inria.fr/FormationIntegrationContinue/gitlabciintroduction) process.\n", "\n", @@ -41,7 +41,7 @@ "\n", "[cpplint](https://github.com/cpplint/cpplint) is also worth a look, we mentioned it for instance in [this chapter](/notebooks/6-InRealEnvironment/2-FileStructure.ipynb) to track down missing includes in files.\n", "\n", - "[clang-tidy](https://clang.llvm.org/extra/clang-tidy/) \n", + "[clang-tidy](https://clang.llvm.org/extra/clang-tidy/) was recently recommanded to us by colleagues from [LoOPS network](https://reseau-loops.github.io/index.html).\n", "\n", "\n", "\n", @@ -51,6 +51,10 @@ "\n", "Unfortunately, macOS support is scarse: sometimes they plainly say it is not up-to-date, but even they say ot works the outputs were never satisfactory for me. So even if I develop mostly in macOS I always fire up valgrind in a Linux environment.\n", "\n", + "## Address sanitizer\n", + "\n", + "A [recent \"concurrent\"](https://github.com/google/sanitizers/wiki/AddressSanitizer) (once again use both if possible!) to Valgrind, which has the advantage of running with a much better runtime (Valgrind slows down your program tremendously). Might be integrated in some IDEs (it is in XCode on macOS).\n", + "\n", "\n", "## Sonarqube\n", "\n", @@ -75,7 +79,7 @@ "\n", "### Google test\n", "\n", - "This test utility provides mocks.\n", + "This test utility is the only one we know that provide mocks; unfortunately I can't give you first-hand feedback.\n", "\n", "\n", "\n", @@ -83,13 +87,13 @@ "\n", "Already mentioned [here](/notebooks/6-InRealEnvironment/1-SetUpEnvironment.ipynb#Build-system).\n", "\n", - "## Debugguer\n", + "## Code formatters\n", "\n", - "I can't help you here much: I'm using the one embedded in my IDE. Most popular choice is probably [GDB](https://www.gnu.org/software/gdb/).\n", + "It is useful to delegate the check on your code format to an external tool, which may take a bit of time to configurate to suit your needs. \n", "\n", - "## Profiler\n", + "I can mention [Uncrustify](http://uncrustify.sourceforge.net/): plenty of options to configure, even if they're not easy to figure out.\n", "\n", - "Likewise; I also use at some point [callgrind](http://valgrind.org/docs/manual/cl-manual.html) which is part of the Valgrind suite. The result on macOS were implausible, so use it on a Linux system...\n", + "[clang-format](https://clang.llvm.org/docs/ClangFormat.html) probably provides a better trade-off power/complexity but requires clang to be installed on your system.\n", "\n", "\n", "## Doxygen\n",