• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mendersoftware / mender / 951586380

pending completion
951586380

push

gitlab-ci

kacf
chore: Use system reboot command when `Automatic` reboot is requested.

I won't add tests for this, because it is much better to test this
properly later when we get our acceptance tests running. It will be
untested till then...

Signed-off-by: Kristian Amlie <kristian.amlie@northern.tech>

16 of 16 new or added lines in 1 file covered. (100.0%)

4268 of 6026 relevant lines covered (70.83%)

147.81 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

95.0
/common/events/platform/boost/events.cpp
1
// Copyright 2023 Northern.tech AS
2
//
3
//    Licensed under the Apache License, Version 2.0 (the "License");
4
//    you may not use this file except in compliance with the License.
5
//    You may obtain a copy of the License at
6
//
7
//        http://www.apache.org/licenses/LICENSE-2.0
8
//
9
//    Unless required by applicable law or agreed to in writing, software
10
//    distributed under the License is distributed on an "AS IS" BASIS,
11
//    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
//    See the License for the specific language governing permissions and
13
//    limitations under the License.
14

15
#include <common/events.hpp>
16

17
#include <boost/asio.hpp>
18

19
namespace mender {
20
namespace common {
21
namespace events {
22

23
namespace asio = boost::asio;
24

25
void EventLoop::Run() {
275✔
26
        bool stopped = ctx_.stopped();
275✔
27
        if (stopped) {
275✔
28
                ctx_.restart();
×
29
        }
30
        ctx_.run();
275✔
31
        if (!stopped) {
275✔
32
                // For recursive invocations. If we were originally running, but we stopped and
33
                // exited this level, then keep the running state of the previous recursive level.
34
                ctx_.restart();
275✔
35
        }
36
}
275✔
37

38
void EventLoop::Stop() {
272✔
39
        ctx_.stop();
272✔
40
}
272✔
41

42
void EventLoop::Post(std::function<void()> func) {
818✔
43
        ctx_.post(func);
818✔
44
}
818✔
45

46
Timer::Timer(EventLoop &loop) :
296✔
47
        timer_(GetAsioIoContext(loop)) {
296✔
48
}
296✔
49

50
void Timer::Cancel() {
458✔
51
        timer_.cancel();
458✔
52
}
458✔
53

54
} // namespace events
55
} // namespace common
56
} // namespace mender
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc