Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Update copyright lines.
[simgrid.git] / teshsuite / s4u / activity-lifecycle / activity-lifecycle.hpp
1 /* Copyright (c) 2010-2021. The SimGrid Team. All rights reserved.          */
2
3 /* This program is free software; you can redistribute it and/or modify it
4  * under the terms of the license (GNU LGPL) which comes with this package. */
5
6 #ifndef ACTIVITY_LIFECYCLE_HPP
7 #define ACTIVITY_LIFECYCLE_HPP
8
9 #include <catch.hpp>
10
11 #include <simgrid/s4u.hpp>
12 #include <xbt/log.h>
13
14 #include <vector>
15
16 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(s4u_test);
17
18 extern std::vector<simgrid::s4u::Host*> all_hosts;
19
20 /* Helper function easing the testing of actor's ending condition */
21 extern void assert_exit(bool exp_success, double duration);
22
23 /* Helper function in charge of doing some sanity checks after each test */
24 extern void assert_cleanup();
25
26 /* We need an extra actor here, so that it can sleep until the end of each test */
27 #define BEGIN_SECTION(descr) SECTION(descr) { simgrid::s4u::Actor::create(descr, all_hosts[0], []()
28 #define END_SECTION })
29
30 #define RUN_SECTION(descr, ...) SECTION(descr) { simgrid::s4u::Actor::create(descr, all_hosts[0], __VA_ARGS__); }
31
32 #endif // ACTIVITY_LIFECYCLE_HPP