Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of https://framagit.org/simgrid/simgrid
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Sat, 2 Feb 2019 08:45:46 +0000 (09:45 +0100)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Sat, 2 Feb 2019 08:45:46 +0000 (09:45 +0100)
12 files changed:
.codacy.yml
.gitignore
doc/doxygen/inside_tests.doc
src/mc/ObjectInformation.hpp
src/mc/checker/simgrid_mc.cpp
src/mc/mc_unw.hpp
src/mc/remote/Channel.cpp
src/mc/remote/Client.cpp
src/mc/remote/RemoteClient.cpp
src/mc/remote/mc_protocol.cpp
src/xbt/dict_test.cpp
tools/cmake/Tests.cmake

index 18e318d..d7f3564 100644 (file)
@@ -5,7 +5,7 @@ engines:
    exclude_paths:
      - teshsuite/**
 exclude_paths:
-  - src/*_unit.c*
+  - src/include/catch.hpp
   - teshsuite/smpi/mpich3-test/**
   - teshsuite/smpi/isp/**
   - **/*_dtd.c
index 34c3dfa..3009272 100644 (file)
@@ -939,7 +939,6 @@ teshsuite/xbt/mmalloc/mmalloc_test
 teshsuite/xbt/parallel_log_crashtest/parallel_log_crashtest
 teshsuite/xbt/parmap_bench/parmap_bench
 teshsuite/xbt/parmap_test/parmap_test
-testall
 unit-tests
 #########################################
 ## files touched to track the dependencies of java examples
index bbbd497..89785dd 100644 (file)
@@ -53,15 +53,15 @@ make unit-tests                 # Rebuild the test runner on need
 
 @section inside_tests_add_units Adding unit tests
 
-@warning this section is outdated. New unit tests should be written
-using the Catch2 library, that is included in the source tree. Please
-check for examples, listed at the end of tools/cmake/Tests.cmake.
-
-Last note: please try to keep your tests fast. We run them very very
-very often, and you should strive to make it as fast as possible, to
-not upset the other developers. Do not hesitate to stress test your
-code with such unit tests, but make sure that it runs reasonably fast,
-or nobody will run "ctest" before commiting code.
+Our unit tests are written using the Catch2 library, that is included
+in the source tree. Please check for examples, listed at the end of
+tools/cmake/Tests.cmake.
+
+It is important to keep your tests fast. We run them very very often,
+and you should strive to make them as fast as possible, to not bother
+the other developers. Do not hesitate to stress test your code, but
+make sure that it runs reasonably fast, or nobody will run "ctest"
+before commiting code.
 
 @section inside_tests_add_integration Adding integration tests
 
index c9249a0..c59369b 100644 (file)
 #include <memory>
 #include <vector>
 
-#include "xbt/base.h"
-
-#include "src/xbt/memory_map.hpp"
-#include "src/mc/mc_forward.hpp"
-#include "src/mc/Type.hpp"
 #include "src/mc/Frame.hpp"
+#include "src/mc/Type.hpp"
+#include "src/mc/mc_forward.hpp"
+#include "src/xbt/memory_map.hpp"
 
 #include "src/smpi/include/private.hpp"
 
index 5394fbe..e8c0ca8 100644 (file)
@@ -4,29 +4,12 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include <exception>
-
-#include <cstdlib>
-#include <cstdio>
-#include <cstring>
-
-#include <utility>
-
-#include <unistd.h>
-
-#include <xbt/log.h>
-
 #include "simgrid/sg_config.hpp"
-#include "src/xbt_modinter.h"
-
-#include "src/mc/Session.hpp"
 #include "src/mc/checker/Checker.hpp"
-#include "src/mc/mc_base.h"
-#include "src/mc/mc_comm_pattern.hpp"
 #include "src/mc/mc_exit.hpp"
-#include "src/mc/mc_private.hpp"
-#include "src/mc/mc_safety.hpp"
-#include "src/mc/remote/mc_protocol.h"
+
+#include <cstring>
+#include <memory>
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_main, mc, "Entry point for simgrid-mc");
 
index 4c302c8..466b3df 100644 (file)
@@ -30,7 +30,6 @@
 
 #include <cstdio>
 #include <libunwind.h>
-#include <sys/types.h>
 
 namespace simgrid {
 namespace unw {
index 7594e5e..3a0c4eb 100644 (file)
@@ -4,16 +4,14 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
+#include "src/mc/remote/Channel.hpp"
+#include <xbt/log.h>
+
 #include <cerrno>
 #include <unistd.h>
-
 #include <sys/socket.h>
 #include <sys/types.h>
 
-#include <xbt/log.h>
-
-#include "src/mc/remote/Channel.hpp"
-
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_Channel, mc, "MC interprocess communication");
 
 namespace simgrid {
index ada56e0..ffbbfae 100644 (file)
@@ -3,28 +3,17 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
+#include "src/mc/remote/Client.hpp"
+#include "src/internal_config.h"
+#include <simgrid/modelchecker.h>
+
 #include <cerrno>
 #include <cstdlib>
 #include <cstring>
-
 #include <sys/ptrace.h>
 #include <sys/socket.h>
 #include <sys/types.h>
 
-#include <xbt/log.h>
-#include <xbt/mmalloc.h>
-#include <xbt/sysdep.h>
-
-#include <simgrid/modelchecker.h>
-
-#include "src/internal_config.h"
-
-#include "src/mc/mc_request.hpp"
-#include "src/mc/remote/Client.hpp"
-#include "src/mc/remote/mc_protocol.h"
-
-#include "src/smpi/include/private.hpp"
-
 // We won't need those once the separation MCer/MCed is complete:
 #include "src/mc/mc_smx.hpp"
 
index 28721c0..8766ad5 100644 (file)
@@ -5,43 +5,16 @@
 
 #define _FILE_OFFSET_BITS 64 /* needed for pread_whole to work as expected on 32bits */
 
-#include <algorithm>
-#include <cassert>
-#include <cerrno>
-#include <cstddef>
-#include <cstdint>
-#include <string>
-#include <vector>
-
-#include <sys/ptrace.h>
-
-#include <cstdio>
-
-#include <fcntl.h>
-#include <sys/mman.h> // PROT_*
-#include <sys/types.h>
-#include <unistd.h>
-
-#include <pthread.h>
-
-#include <libgen.h>
-
-#include <libunwind-ptrace.h>
-#include <libunwind.h>
+#include "src/mc/remote/RemoteClient.hpp"
 
-#include "xbt/base.h"
 #include "xbt/file.hpp"
 #include "xbt/log.h"
-#include <xbt/mmalloc.h>
-
 #include "src/mc/mc_smx.hpp"
-#include "src/mc/mc_unw.hpp"
 #include "src/mc/sosp/mc_snapshot.hpp"
 
-#include "src/mc/AddressSpace.hpp"
-#include "src/mc/ObjectInformation.hpp"
-#include "src/mc/Variable.hpp"
-#include "src/mc/remote/RemoteClient.hpp"
+#include <fcntl.h>
+#include <libunwind-ptrace.h>
+#include <sys/mman.h> // PROT_*
 
 using simgrid::mc::remote;
 
index 7aed216..f014ece 100644 (file)
@@ -4,21 +4,8 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include <cerrno>
-#include <cstddef> // std::size_t
-#include <cstdio>  // perror
-#include <cstring>
-
-#include <sys/socket.h>
-#include <sys/types.h>
-
-#include <xbt/log.h>
-
-#include "src/mc/remote/Client.hpp"
 #include "src/mc/remote/mc_protocol.h"
 
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_protocol, mc, "Generic MC protocol logic");
-
 const char* MC_message_type_name(e_mc_message_type type)
 {
   switch (type) {
index 6cd12ea..dd2fc82 100644 (file)
@@ -86,11 +86,7 @@ static void traverse(xbt_dict_t head)
   int i = 0;
 
   xbt_dict_foreach (head, cursor, key, data) {
-    if (not key || not data || strcmp(key, data)) {
-      INFO("Seen #" << ++i << ": " << STR(key) << "->" << STR(data));
-    } else {
-      INFO("Seen #" << ++i << ": " << STR(key));
-    }
+    INFO("Seen #" << ++i << ": " << STR(key) << "->" << STR(data));
     REQUIRE((key && data && strcmp(key, data) == 0)); //  key != value
   }
 }
@@ -282,23 +278,18 @@ TEST_CASE("xbt::dict: dict data container", "dict")
     search_ext(head, "null", nullptr);
 
     INFO("Check whether I see it while traversing...");
-    {
-      xbt_dict_cursor_t cursor = nullptr;
-      char* key;
-      int found = 0;
-      char* data;
-
-      xbt_dict_foreach (head, cursor, key, data) {
-        if (not key || not data || strcmp(key, data)) {
-          INFO("Seen: " << STR(key) << "->" << STR(data));
-        } else {
-          INFO("Seen: " << STR(key));
-        }
-        if (key && strcmp(key, "null") == 0)
-          found = 1;
-      }
-      REQUIRE(found); // the key 'null', associated to nullptr is not found
+    xbt_dict_cursor_t cursor = nullptr;
+    char* key;
+    bool found = false;
+    char* data;
+
+    xbt_dict_foreach (head, cursor, key, data) {
+      INFO("Seen: " << STR(key) << "->" << STR(data));
+      if (key && strcmp(key, "null") == 0)
+        found = true;
     }
+    REQUIRE(found); // the key 'null', associated to nullptr is not found
+
     xbt_dict_free(&head);
   }
 
index 7bc0867..8f40b96 100644 (file)
@@ -120,8 +120,6 @@ IF(SIMGRID_HAVE_LUA)
   SET_TESTS_PROPERTIES(lua-platform-masterslave    PROPERTIES ENVIRONMENT "LUA_CPATH=${CMAKE_BINARY_DIR}/lib/lib?.${LIB_EXE}")
 ENDIF()
 
-ADD_TEST(testall                                 ${CMAKE_BINARY_DIR}/testall)
-
 # New tests should use the Catch Framework
 set(UNIT_TESTS  src/surf/trace_mgr_test.cpp
                 src/xbt/config_test.cpp