Skip to content

Commit 30d4a56

Browse files
strongly-typedsalkinium
authored andcommitted
[tests] Move CanDriver to modm-test/mock as it implements modm::Can
1 parent b75face commit 30d4a56

File tree

5 files changed

+22
-2
lines changed

5 files changed

+22
-2
lines changed

test/modm/communication/module.lb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#
44
# Copyright (c) 2016-2018, Niklas Hauser
55
# Copyright (c) 2017, Fabian Greif
6+
# Copyright (c) 2020, Sascha Schade
67
#
78
# This file is part of the modm project.
89
#
@@ -41,7 +42,11 @@ class Xpcc(Module):
4142
module.name = "xpcc"
4243

4344
def prepare(self, module, options):
44-
module.depends("modm:communication:xpcc", ":mock:clock")
45+
module.depends(
46+
"modm:communication:xpcc",
47+
":mock:clock",
48+
":mock:can_driver",
49+
)
4550
return True
4651

4752
def build(self, env):

test/modm/communication/xpcc/backend/can/testing_can_connector.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
#include <modm/communication/xpcc/backend/can/connector.hpp>
1919

20-
#include "can_driver.hpp"
20+
#include <modm-test/mock/can_driver.hpp>
2121

2222
/// @ingroup modm_test_test_communication
2323
class TestingCanConnector : public xpcc::CanConnector<modm_test::platform::CanDriver>
File renamed without changes.
File renamed without changes.

test/modm/mock/module.lb

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,20 @@ class SpiMaster(Module):
5050
env.copy("spi_master.hpp")
5151
env.copy("spi_master.cpp")
5252

53+
class CanDriver(Module):
54+
def init(self, module):
55+
module.name = "can_driver"
56+
module.description = "CAN Mockup"
57+
58+
def prepare(self, module, options):
59+
module.depends(":architecture:can", ":container")
60+
return True
61+
62+
def build(self, env):
63+
env.outbasepath = "modm-test/src/modm-test/mock"
64+
env.copy("can_driver.hpp")
65+
env.copy("can_driver.cpp")
66+
5367
class IoDevice(Module):
5468
def init(self, module):
5569
module.name = "io.device"
@@ -100,6 +114,7 @@ def prepare(module, options):
100114
module.add_submodule(Clock())
101115
module.add_submodule(SpiDevice())
102116
module.add_submodule(SpiMaster())
117+
module.add_submodule(CanDriver())
103118
module.add_submodule(IoDevice())
104119
module.add_submodule(SharedMedium())
105120
module.add_submodule(LogicAnalyzer())

0 commit comments

Comments
 (0)