exclude_paths:
- teshsuite/**
exclude_paths:
- - src/*_unit.c*
+ - src/include/catch.hpp
- teshsuite/smpi/mpich3-test/**
- teshsuite/smpi/isp/**
- **/*_dtd.c
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
@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
#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"
/* 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");
#include <cstdio>
#include <libunwind.h>
-#include <sys/types.h>
namespace simgrid {
namespace unw {
/* 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 {
/* 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"
#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;
/* 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) {
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
}
}
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);
}
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