-
Notifications
You must be signed in to change notification settings - Fork 5
/
test_firmware.py
110 lines (87 loc) · 4.62 KB
/
test_firmware.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
import unittest
from utils import util
import config
class Basic(unittest.TestCase):
def test_shows_up_as_serial(self):
print("This test requires you to interact with dualpanto device and test it physically using test paper-jig.")
print("Please check./physical_test/line wall/README.md")
print("When you tested, please press Enter key.")
self.assertIn(config.COM_PORT, util.serial_ports())
def test_compile_firmware(self):
res = util.compile_firmware('firmware/hello world')
self.assertEqual(res, 0, msg='failed to compile firmware. please first check platformIO config and installation')
def test_upload_firmware(self):
res = util.upload_firmware('./firmware/hello world')
self.assertEqual(res, 0, msg='failed to upload firmware. please first check platformIO config and installation')
class Haptics(unittest.TestCase):
def test_line_wall(self):
res = util.upload_firmware("firmware/haptics/line wall/firmware", False)
print("")
print("==========================")
print("===== TEST LINE WALL =====")
print("==========================")
print("")
print("This test requires you to interact with dualpanto device and test it physically using test paper-jig.")
print("Please check./physical_test/line wall/README.md")
print("When you tested, please press Enter key.")
print("")
print("==========================")
print("===== TEST LINE WALL =====")
print("==========================")
input()
self.assertEqual(res, 0, msg='failed to upload firmware. please first check platformIO config and installation')
def test_force_field(self):
res = util.upload_firmware("firmware/haptics/force field/firmware", False)
print("")
print("==========================")
print("==== TEST FORCE FIELD ====")
print("==========================")
print("")
print("This test requires you to interact with dualpanto device and test it physically using test paper-jig.")
print("Please check./physical_test/line wall/README.md")
print("When you tested, please press Enter key.")
print("")
print("==========================")
print("==== TEST FORCE FIELD ====")
print("==========================")
print("")
self.assertEqual(res, 0, msg='failed to upload firmware. please first check platformIO config and installation')
def test_BIS_week7_go(self):
res = util.upload_firmware("firmware/haptics/BIS week7 God Object/firmware", False)
print("")
print("====================================")
print("======= BIS WEEK7 GOD OBJECT =======")
print("====================================")
print("")
print("This test requires you to interact with dualpanto device and test it physically.")
print("Please check./BIS/")
print("When you tested, please press Enter key.")
print("")
print("====================================")
print("======= BIS WEEK7 GOD OBJECT =======")
print("====================================")
print("")
self.assertEqual(res, 0, msg='failed to upload firmware. please first check platformIO config and installation')
class Kinematics(unittest.TestCase):
def test_kinematics_sync(self):
res = util.upload_firmware("firmware/haptics/kinematics/firmware", False)
self.assertEqual(res, 0, msg='failed to upload firmware. please first check platformIO config and installation')
def test_BIS_week7_kinematics(self):
res = util.upload_firmware("firmware/haptics/BIS week7 Kinematics/firmware", False)
print("")
print("====================================")
print("======= BIS WEEK7 KINEMATICS =======")
print("====================================")
print("")
print("This test requires you to interact with dualpanto device and test it physically")
print("Please check./BIS/BIS.md")
print("")
print("====================================")
print("======= BIS WEEK7 KINEMATICS =======")
print("====================================")
print("")
self.assertEqual(res, 0, msg='failed to upload firmware. please first check platformIO config and installation')
class UploadDualPantoFramework(unittest.TestCase):
def test_upload_dp_firmware(self):
res = util.upload_firmware('./firmware/dualpantoframework/firmware')
self.assertEqual(res, 0, msg='failed to compile firmware. please first check platformIO config and installation')