Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
use listen_from in s4u test and kill the MSG one
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Mon, 30 Mar 2020 13:18:55 +0000 (15:18 +0200)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Mon, 30 Mar 2020 13:18:55 +0000 (15:18 +0200)
MANIFEST.in
teshsuite/msg/CMakeLists.txt
teshsuite/msg/task_listen_from/task_listen_from.c [deleted file]
teshsuite/msg/task_listen_from/task_listen_from.tesh [deleted file]
teshsuite/s4u/listen_async/listen_async.cpp
teshsuite/s4u/listen_async/listen_async.tesh

index c5d7fa8..903dc9b 100644 (file)
@@ -662,8 +662,6 @@ include teshsuite/mc/random-bug/random-bug.cpp
 include teshsuite/mc/random-bug/random-bug.tesh
 include teshsuite/msg/task_destroy_cancel/task_destroy_cancel.c
 include teshsuite/msg/task_destroy_cancel/task_destroy_cancel.tesh
-include teshsuite/msg/task_listen_from/task_listen_from.c
-include teshsuite/msg/task_listen_from/task_listen_from.tesh
 include teshsuite/python/borken-context/borken-context.py
 include teshsuite/python/borken-context/borken-context.tesh
 include teshsuite/python/borken-context/borken-context_d.xml
index 765e69c..7ceb026 100644 (file)
@@ -1,24 +1,14 @@
-foreach(x task_listen_from task_destroy_cancel)
-  if(enable_msg)
-    add_executable       (${x} EXCLUDE_FROM_ALL ${x}/${x}.c)
-    target_link_libraries(${x} simgrid)
-    set_target_properties(${x} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${x})
-    add_dependencies(tests ${x})
-  endif()
-
-  set(tesh_files    ${tesh_files}    ${CMAKE_CURRENT_SOURCE_DIR}/${x}/${x}.tesh)
-  set(teshsuite_src ${teshsuite_src} ${CMAKE_CURRENT_SOURCE_DIR}/${x}/${x}.c)
-endforeach()
-
-set(teshsuite_src ${teshsuite_src}  PARENT_SCOPE)
-set(tesh_files    ${tesh_files}     PARENT_SCOPE)
-
 if(enable_msg)
-  foreach(x task_destroy_cancel task_listen_from)
-
-    ADD_TESH_FACTORIES(tesh-msg-${x} "raw"  --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms
-                                            --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/msg/${x}
-                                            --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/${x} 
-                                            ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/${x}/${x}.tesh)
-  endforeach()
+  add_executable       (task_destroy_cancel EXCLUDE_FROM_ALL task_destroy_cancel/task_destroy_cancel.c)
+  target_link_libraries(task_destroy_cancel simgrid)
+  set_target_properties(task_destroy_cancel PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/task_destroy_cancel)
+  add_dependencies(tests task_destroy_cancel)
+
+  ADD_TESH_FACTORIES(tesh-msg-task_destroy_cancel "raw"  --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms
+                                                         --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/msg/task_destroy_cancel
+                                                         --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/task_destroy_cancel 
+                                                         ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/task_destroy_cancel/task_destroy_cancel.tesh)
 endif()
+
+set(tesh_files    ${tesh_files}    ${CMAKE_CURRENT_SOURCE_DIR}/task_destroy_cancel/task_destroy_cancel.tesh PARENT_SCOPE)
+set(teshsuite_src ${teshsuite_src} ${CMAKE_CURRENT_SOURCE_DIR}/task_destroy_cancel/task_destroy_cancel.c PARENT_SCOPE)
diff --git a/teshsuite/msg/task_listen_from/task_listen_from.c b/teshsuite/msg/task_listen_from/task_listen_from.c
deleted file mode 100644 (file)
index 87dab4f..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/* Copyright (c) 2017-2020. The SimGrid Team. All rights reserved.          */
-
-/* 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. */
-
-/* This is the test case of GitHub's #121 */
-
-#include "simgrid/msg.h"
-
-XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example");
-
-static int tester(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
-{
-  msg_task_t task       = MSG_task_create("name", 0, 10, NULL);
-  const_msg_comm_t comm = MSG_task_isend(task, "mailbox");
-
-  XBT_INFO("MSG_task_listen_from returns() %d (should return my pid, which is %d)", MSG_task_listen_from("mailbox"),
-           MSG_process_get_PID(MSG_process_self()));
-  XBT_INFO("MSG_task_listen returns()      %d (should return true, i.e. 1)", MSG_task_listen("mailbox"));
-
-  MSG_comm_destroy(comm);
-  MSG_task_destroy(task);
-
-  return 0;
-}
-
-int main(int argc, char* argv[])
-{
-  MSG_init(&argc, argv);
-  xbt_assert(argc == 2, "Usage: %s platform_file\n\tExample: %s msg_platform.xml\n", argv[0], argv[0]);
-  MSG_create_environment(argv[1]);
-
-  MSG_process_create("tester", tester, NULL, MSG_get_host_by_name("Tremblay"));
-
-  return MSG_main();
-}
diff --git a/teshsuite/msg/task_listen_from/task_listen_from.tesh b/teshsuite/msg/task_listen_from/task_listen_from.tesh
deleted file mode 100644 (file)
index 6033f40..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-$ ${bindir}/task_listen_from ${platfdir}/small_platform.xml
-> [Tremblay:tester:(1) 0.000000] [msg_test/INFO] MSG_task_listen_from returns() 1 (should return my pid, which is 1)
-> [Tremblay:tester:(1) 0.000000] [msg_test/INFO] MSG_task_listen returns()      1 (should return true, i.e. 1)
index 8002e01..e277a3d 100644 (file)
@@ -21,6 +21,9 @@ static void server()
 
   xbt_assert(mailbox->listen()); // True (1)
   XBT_INFO("Task listen works on regular mailboxes");
+  XBT_INFO("Mailbox::listen_from() returns %ld (should return my pid, which is %ld)", mailbox->listen_from(),
+           simgrid::s4u::this_actor::get_pid());
+
   const std::string* res = static_cast<std::string*>(mailbox->get());
 
   xbt_assert(*res == "Some data", "Data received: %s", res->c_str());
index d196f6e..9d3157c 100644 (file)
@@ -1,5 +1,6 @@
 $ ./listen_async ${platfdir}/small_platform.xml "--log=root.fmt:[%10.6r]%e(%P@%h)%e%m%n"
 > [  0.000000] (test@Tremblay) Task listen works on regular mailboxes
+> [  0.000000] (test@Tremblay) Mailbox::listen_from() returns 1 (should return my pid, which is 1)
 > [  0.000195] (test@Tremblay) Data successfully received from regular mailbox
 > [  0.000195] (test@Tremblay) Task listen works on asynchronous mailboxes
 > [  0.000195] (test@Tremblay) Data successfully received from asynchronous mailbox